mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 09:34:38 +02:00
8229212: clear up CHECK_OWNER confusion in objectMonitor.cpp
Reviewed-by: dholmes, coleenp
This commit is contained in:
parent
cf9351a41f
commit
2207d884d5
5 changed files with 119 additions and 45 deletions
|
@ -429,9 +429,10 @@ void ObjectSynchronizer::jni_exit(oop obj, Thread* THREAD) {
|
|||
assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
|
||||
|
||||
ObjectMonitor* monitor = inflate(THREAD, obj, inflate_cause_jni_exit);
|
||||
// If this thread has locked the object, exit the monitor. Note: can't use
|
||||
// monitor->check(CHECK); must exit even if an exception is pending.
|
||||
if (monitor->check(THREAD)) {
|
||||
// If this thread has locked the object, exit the monitor. We
|
||||
// intentionally do not use CHECK here because we must exit the
|
||||
// monitor even if an exception is pending.
|
||||
if (monitor->check_owner(THREAD)) {
|
||||
monitor->exit(true, THREAD);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue