mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8194406: Use Atomic::replace_if_null
Reviewed-by: coleenp, dholmes
This commit is contained in:
parent
c7e601e911
commit
9e5bf18428
9 changed files with 17 additions and 18 deletions
|
@ -77,7 +77,7 @@ GCTaskTimeStamp* GCTaskThread::time_stamp_at(uint index) {
|
|||
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) {
|
||||
if (!Atomic::replace_if_null(time_stamps, &_time_stamps)) {
|
||||
// Someone already setup the time stamps
|
||||
FREE_C_HEAP_ARRAY(GCTaskTimeStamp, time_stamps);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue