mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8365556: ObjectMonitor::try_lock_or_add_to_entry_list() returns true with the wrong state of the node
Reviewed-by: pchilanomate, dholmes, fbredberg
This commit is contained in:
parent
9c338f6f87
commit
70f3469310
@ -711,6 +711,7 @@ void ObjectMonitor::add_to_entry_list(JavaThread* current, ObjectWaiter* node) {
|
||||
// if we added current to _entry_list. Once on _entry_list, current
|
||||
// stays on-queue until it acquires the lock.
|
||||
bool ObjectMonitor::try_lock_or_add_to_entry_list(JavaThread* current, ObjectWaiter* node) {
|
||||
assert(node->TState == ObjectWaiter::TS_RUN, "");
|
||||
node->_prev = nullptr;
|
||||
node->TState = ObjectWaiter::TS_ENTER;
|
||||
|
||||
@ -726,6 +727,7 @@ bool ObjectMonitor::try_lock_or_add_to_entry_list(JavaThread* current, ObjectWai
|
||||
if (try_lock(current) == TryLockResult::Success) {
|
||||
assert(!has_successor(current), "invariant");
|
||||
assert(has_owner(current), "invariant");
|
||||
node->TState = ObjectWaiter::TS_RUN;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user