RFR: 8255678: Add Mutex::try_lock version without rank checks [v2]
Patricio Chilano Mateo
pchilanomate at openjdk.java.net
Thu Nov 19 02:58:02 UTC 2020
On Wed, 18 Nov 2020 22:53:22 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> How about just:
>> bool Mutex::try_lock() {
>> Thread * const self = Thread::current();
>> DEBUG_ONLY(if (!owned_by_self()) check_rank(self);)
>> return try_lock_inner(self);
>> }
>> keeping try_lock_without_rank_check() as is. Then I can merge try_lock_inner() with your patch.
>
> If the existing try_lock become try_lock_inner then you are duplicating the owner check. My suggestion minimises code duplication allowing both try_lock and try_lock_without_rank_check to just be simple inline definitions.
> My changes just integrated so you can merge now.
> Thanks.
Ok, makes sense. I updated the code with the suggested change.
Thanks!
-------------
PR: https://git.openjdk.java.net/jdk/pull/1242
More information about the hotspot-runtime-dev
mailing list