RFR: Refactor ShenandoahHeapLock

Aleksey Shipilev shade at redhat.com
Fri Aug 25 10:52:36 UTC 2017


On 08/25/2017 12:43 PM, Roman Kennke wrote:
> This looks a bit odd:
> 
> - ShenandoahHeapLock lock(this);
> + ShenandoahHeapLocker lock(locker());
> 
> You ask for a ShenandoahHeapLocker() via locker(). This creates on-stack a SHL using the _lock. Then
> this is copied (or optimized away) into another SHL on-stack, via (implicit) copy-constructor. This
> works, but it would look less confusing to just write:
> 
> ShenandoahHeapLocker locker(lock());

Yes, this is better!

See:
 http://cr.openjdk.java.net/~shade/shenandoah/heaplock-refactor/webrev.02/

Thanks,
-Aleksey




More information about the shenandoah-dev mailing list