< prev index next >

src/hotspot/share/gc/parallel/gcTaskThread.cpp

Print this page
rev 47408 : [mq]: no_cmpxchg_if_null
rev 47401 : [mq]: cmpxchg_if_null
rev 47400 : [mq]: cmpxchg_ptr
rev 47216 : 8187443: Forest Consolidation: Move files to unified layout
Reviewed-by: darcy, ihse

*** 75,85 **** GCTaskTimeStamp* GCTaskThread::time_stamp_at(uint index) { assert(index < GCTaskTimeStampEntries, "Precondition"); if (_time_stamps == NULL) { // We allocate the _time_stamps array lazily since logging can be enabled dynamically GCTaskTimeStamp* time_stamps = NEW_C_HEAP_ARRAY(GCTaskTimeStamp, GCTaskTimeStampEntries, mtGC); ! if (!Atomic::cmpxchg_if_null(time_stamps, &_time_stamps)) { // Someone already setup the time stamps FREE_C_HEAP_ARRAY(GCTaskTimeStamp, time_stamps); } } return &(_time_stamps[index]); --- 75,85 ---- GCTaskTimeStamp* GCTaskThread::time_stamp_at(uint index) { assert(index < GCTaskTimeStampEntries, "Precondition"); if (_time_stamps == NULL) { // We allocate the _time_stamps array lazily since logging can be enabled dynamically GCTaskTimeStamp* time_stamps = NEW_C_HEAP_ARRAY(GCTaskTimeStamp, GCTaskTimeStampEntries, mtGC); ! if (Atomic::cmpxchg(time_stamps, &_time_stamps, (GCTaskTimeStamp*)NULL) != NULL) { // Someone already setup the time stamps FREE_C_HEAP_ARRAY(GCTaskTimeStamp, time_stamps); } } return &(_time_stamps[index]);
< prev index next >