mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 17:44:40 +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
|
@ -238,8 +238,7 @@ bool ObjectSynchronizer::quick_enter(oop obj, Thread * Self,
|
|||
// and last are the inflated Java Monitor (ObjectMonitor) checks.
|
||||
lock->set_displaced_header(markOopDesc::unused_mark());
|
||||
|
||||
if (owner == NULL &&
|
||||
Atomic::cmpxchg(Self, &(m->_owner), (void*)NULL) == NULL) {
|
||||
if (owner == NULL && Atomic::replace_if_null(Self, &(m->_owner))) {
|
||||
assert(m->_recursions == 0, "invariant");
|
||||
assert(m->_owner == Self, "invariant");
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue