mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
6699669: Hotspot server leaves synchronized block with monitor in bad state
Remove usage of _highest_lock field in Thread so that is_lock_owned won't depend on the correct update of that field. Reviewed-by: never, dice, acorn
This commit is contained in:
parent
e1b2c1c442
commit
62fa852746
8 changed files with 37 additions and 79 deletions
|
@ -1117,10 +1117,10 @@ ObjectMonitor * ATTR ObjectSynchronizer::inflate (Thread * Self, oop object) {
|
|||
|
||||
// Optimization: if the mark->locker stack address is associated
|
||||
// with this thread we could simply set m->_owner = Self and
|
||||
// m->OwnerIsThread = 1. Note that a thread can inflate an object
|
||||
// m->OwnerIsThread = 1. 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_owner(mark->locker());
|
||||
m->set_object(object);
|
||||
// TODO-FIXME: assert BasicLock->dhw != 0.
|
||||
|
||||
|
@ -1214,10 +1214,9 @@ void ObjectSynchronizer::fast_enter(Handle obj, BasicLock* lock, bool attempt_re
|
|||
BiasedLocking::revoke_at_safepoint(obj);
|
||||
}
|
||||
assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
|
||||
}
|
||||
}
|
||||
|
||||
THREAD->update_highest_lock((address)lock);
|
||||
slow_enter (obj, lock, THREAD) ;
|
||||
slow_enter (obj, lock, THREAD) ;
|
||||
}
|
||||
|
||||
void ObjectSynchronizer::fast_exit(oop object, BasicLock* lock, TRAPS) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue