RFR: ShConcurrentThread races with set_gc_state_bit

Zhengyu Gu zgu at redhat.com
Tue Jan 16 19:38:49 UTC 2018



On 01/16/2018 02:34 PM, Aleksey Shipilev wrote:
> On 01/16/2018 08:33 PM, Zhengyu Gu wrote:
>> 661 void ShenandoahHeap::set_gc_state_bit_concurrently(uint bit, bool value) {
>> 1662   _gc_state.set_cond(bit, value);
>> 1663   MutexLocker mu(Threads_lock);
>> 1664   JavaThread::set_gc_state_all_threads(_gc_state.raw_value());
>>
>>
>> I wonder if you want to move _gc_state.set_cond(bit, value) into locked section? In case that global
>> state is set, then we hit a safepoint ... not sure if it is matter.
> 
> Does not really matter: the Threads_lock is here to capture all threads. The GC state manipulation
> is MT-safe in itself.
OK.

Thanks,

-Zhengyu

> 
> Thanks,
> -Aleksey
> 


More information about the shenandoah-dev mailing list