RFR: 8212748: ZGC: Add reentrant locking functionality

Per Liden per.liden at oracle.com
Wed Nov 21 20:08:49 UTC 2018

On 2018-11-21 14:45, Kim Barrett wrote:
>>> What is RecursiveZLock::is_owned for?  That might be why the RECURSIVE
>>> attribute wasn't used, but since I don't see the point, except perhaps
>>> for assertion checks.  Part of my question is, if is_owned is
>>> desirable for recursive case, why not for ordinary?  A similar
>>> implementation would seem to suffice.
>> Yes, is_owned() is used in some asserts, but more importantly it's used in few other cases too. The locking around concurrent class unloading is a bit messy, but in some contexts (which has multiple entry points) is_owned() is used to figure out if it's safe to do some operations because the thread has the lock, or if that should be postponed.
> That sounds rather icky.

Yes, the locking issues related to class unloading is super-icky. I hope 
we'll eventually get to a point where all that icky-ness goes away (and 
hopefully ZReentrantLock can also go away). But it might take some time 
to get there.

> Change looks good.

Thanks for reviewing.


More information about the hotspot-gc-dev mailing list