RFR: 8255678: Add Mutex::try_lock version without rank checks [v2]
Patricio Chilano Mateo
pchilanomate at openjdk.java.net
Thu Nov 19 03:40:07 UTC 2020
On Thu, 19 Nov 2020 03:07:04 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
>>
>> address Dan's comments
>
> src/hotspot/share/runtime/mutex.cpp line 400:
>
>> 398: if (owned_by_self()) {
>> 399: // wait() case
>> 400: Mutex* least = get_least_ranked_lock_besides_this(locks_owned);
>
> Wouldn't you want to test check_can_be_skipped before all this code and skip all of this?
For the wait() case, today we always check that the thread doesn't wait while holding a Mutex/Monitor of rank less than or equal to special, and I didn't want to change that.
But I could do it for the "lock()/lock_without_safepoint_check()/try_lock()" case, and return before calling get_least_ranked_lock().
-------------
PR: https://git.openjdk.java.net/jdk/pull/1242
More information about the hotspot-runtime-dev
mailing list