--- old/src/share/vm/gc/parallel/gcTaskThread.cpp 2016-09-23 15:28:41.670168836 +0200 +++ new/src/share/vm/gc/parallel/gcTaskThread.cpp 2016-09-23 15:28:41.510168829 +0200 @@ -58,12 +58,7 @@ guarantee(index < GCTaskTimeStampEntries, "increase GCTaskTimeStampEntries"); 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); - void* old = Atomic::cmpxchg_ptr(time_stamps, &_time_stamps, NULL); - if (old != NULL) { - // Someone already setup the time stamps - FREE_C_HEAP_ARRAY(GCTaskTimeStamp, time_stamps); - } + _time_stamps = NEW_C_HEAP_ARRAY(GCTaskTimeStamp, GCTaskTimeStampEntries, mtGC); } return &(_time_stamps[index]); @@ -140,8 +135,6 @@ // Use the saved value of is_idle_task because references // using "task" are not reliable for the barrier task. if (!is_idle_task) { - manager()->note_completion(which()); - if (log_is_enabled(Debug, gc, task, time)) { timer.update(); @@ -150,11 +143,9 @@ time_stamp->set_name(name); time_stamp->set_entry_time(entry_time); time_stamp->set_exit_time(timer.ticks()); - - // Update the index after we have set up the entry correctly since - // GCTaskThread::print_task_time_stamps() may read this value concurrently. _time_stamp_index++; } + manager()->note_completion(which()); } else { // idle tasks complete outside the normal accounting // so that a task can complete without waiting for idle tasks.