RFR: Refactor ShenandoahHeapLock

Roman Kennke rkennke at redhat.com
Fri Aug 25 10:53:46 UTC 2017


Am 25.08.2017 um 12:52 schrieb Aleksey Shipilev:
> 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
> 
> 

Great! Go!


More information about the shenandoah-dev mailing list