src/hotspot/share/utilities/singleWriterSynchronizer.cpp
changeset 59252 623722a6aeb9
parent 59249 29b0d0b61615
equal deleted inserted replaced
59251:4cbfa5077d68 59252:623722a6aeb9
    62   // operations until this change of _enter succeeds.
    62   // operations until this change of _enter succeeds.
    63   uint old;
    63   uint old;
    64   do {
    64   do {
    65     old = value;
    65     old = value;
    66     *new_ptr = ++value;
    66     *new_ptr = ++value;
    67     value = Atomic::cmpxchg(value, &_enter, old);
    67     value = Atomic::cmpxchg(&_enter, old, value);
    68   } while (old != value);
    68   } while (old != value);
    69   // Critical sections entered before we changed the polarity will use
    69   // Critical sections entered before we changed the polarity will use
    70   // the old exit counter.  Critical sections entered after the change
    70   // the old exit counter.  Critical sections entered after the change
    71   // will use the new exit counter.
    71   // will use the new exit counter.
    72   volatile uint* old_ptr = &_exit[old & 1];
    72   volatile uint* old_ptr = &_exit[old & 1];