< prev index next >

src/hotspot/share/runtime/synchronizer.cpp

Print this page
rev 57232 : [mq]: 8236035.patch.cr0

*** 238,248 **** // stack-locking in the object's header, the third check is for // recursive stack-locking in the displaced header in the BasicLock, // and last are the inflated Java Monitor (ObjectMonitor) checks. lock->set_displaced_header(markWord::unused_mark()); ! if (owner == NULL && Atomic::replace_if_null(&(m->_owner), self)) { assert(m->_recursions == 0, "invariant"); return true; } } --- 238,248 ---- // stack-locking in the object's header, the third check is for // recursive stack-locking in the displaced header in the BasicLock, // and last are the inflated Java Monitor (ObjectMonitor) checks. lock->set_displaced_header(markWord::unused_mark()); ! if (owner == NULL && m->try_set_owner_from(NULL, self) == NULL) { assert(m->_recursions == 0, "invariant"); return true; } }
*** 1402,1412 **** // Optimization: if the mark.locker stack address is associated // with this thread we could simply set m->_owner = self. // Note that a thread can inflate an object // that it has stack-locked -- as might happen in wait() -- directly // with CAS. That is, we can avoid the xchg-NULL .... ST idiom. ! m->set_owner(mark.locker()); m->set_object(object); // TODO-FIXME: assert BasicLock->dhw != 0. // Must preserve store ordering. The monitor state must // be stable at the time of publishing the monitor address. --- 1402,1412 ---- // Optimization: if the mark.locker stack address is associated // with this thread we could simply set m->_owner = self. // Note that a thread can inflate an object // that it has stack-locked -- as might happen in wait() -- directly // with CAS. That is, we can avoid the xchg-NULL .... ST idiom. ! m->simply_set_owner_from(NULL, mark.locker()); m->set_object(object); // TODO-FIXME: assert BasicLock->dhw != 0. // Must preserve store ordering. The monitor state must // be stable at the time of publishing the monitor address.
< prev index next >