Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
ccdd279
Allow virtual threads to unmount while holding monitors
pchilano Oct 15, 2024
54813cd
Allow virtual threads to unmount when blocked on synchronized
pchilano Oct 16, 2024
21c3353
Allow virtual threads to unmount when blocked on Object.wait()
pchilano Oct 16, 2024
9baaff9
Test changes + JFR Updates + Library code changes
pchilano Oct 16, 2024
6a81ccd
Add PPC64 support
pchilano Oct 18, 2024
32840de
RISC-V: Avoid return misprediction
pchilano Oct 21, 2024
5c76442
Adjust comment in JavaThread.hpp
pchilano Oct 21, 2024
8c196ac
Adjust spacing in test JfrEvents.java
pchilano Oct 21, 2024
2ddbb3c
Revert and simplify changes to c1_Runtime1 on aarch64 and riscv
pchilano Oct 21, 2024
06f3732
Fix comments in c2 locking paths
pchilano Oct 21, 2024
f8616a5
remove usage of frame::metadata_words in possibly_adjust_frame()
pchilano Oct 21, 2024
fbd0cad
Fix typo in jvmtiExport.cpp
pchilano Oct 21, 2024
4cec62a
Move frame::saved_thread_address() to platform dependent files
pchilano Oct 21, 2024
23d1a2b
Fix comments in objectMonitor.hpp
pchilano Oct 21, 2024
81e5c6d
Make lea with RIP-relative addressing more general
pchilano Oct 22, 2024
b6bc98e
Address David's comments to ObjectMonitor.hpp
pchilano Oct 23, 2024
d43c084
Clear oops when thawing lockstack + add thaw_lockstack()
pchilano Oct 23, 2024
ab087a5
Fix comment in Thread.java
pchilano Oct 23, 2024
e232b7f
Rename timedWaitNonce to timedWaitSeqNo
pchilano Oct 23, 2024
baf7ffa
Minor fixes in inc/dec_held_monitor_count on aarch64 and riscv
pchilano Oct 23, 2024
0ebc3e9
Skip printing tid when not available
pchilano Oct 24, 2024
03ba6df
Fix comment in objectMonitor.hpp and javaThread.hpp
pchilano Oct 24, 2024
13353fd
Remove ObjectMonitor::set_owner_from_BasicLock()
pchilano Oct 24, 2024
d40d382
Rename nonce/nounce to seqNo in VirtualThread class
pchilano Oct 24, 2024
34362b9
Fix comments in javaThread.hpp and Thread.java
pchilano Oct 24, 2024
c7a82c4
Rename set/has_owner_anonymous to set/has_anonymous_owner
pchilano Oct 24, 2024
1785501
Fix JvmtiUnmountBeginMark
pchilano Oct 25, 2024
0308ee4
Add comments for Coleen
pchilano Oct 25, 2024
3479dba
Move condition to new line in nmethod::preserve_callee_argument_oops
pchilano Oct 25, 2024
d6313cf
Add/fix comments for David
pchilano Oct 25, 2024
4a9c030
remove interruptible check from conditional in Object::wait
pchilano Oct 25, 2024
66d5385
Restore use of atPointA in test StopThreadTest.java
pchilano Oct 25, 2024
7df17a3
Rename inflating_thread to locking_thread
pchilano Oct 28, 2024
1ff336b
Make member functions in ObjectWaiter const
pchilano Oct 28, 2024
c513ae3
add authenticate_return_address() in StubAssembler::epilogue
pchilano Oct 28, 2024
7cb4cff
Simplify set last_sp in prepare_freeze_interpreted_top_frame
pchilano Oct 28, 2024
bd918fa
extra suggestion to prepare_freeze_interpreted_top_frame
pchilano Oct 28, 2024
33cf05f
Remove generate_cont_resume_monitor_operation() + comment in ObjectSy…
pchilano Oct 28, 2024
fc9aa07
Fix vmStructs definitions
pchilano Oct 28, 2024
056d21e
Fix comment in VThreadWaitReenter
pchilano Oct 28, 2024
3e8b4fe
Improve comment in SharedRuntime::generate_native_wrapper
pchilano Oct 29, 2024
e4b0020
add assert in ThawBase::recurse_thaw_interpreted_frame
pchilano Oct 29, 2024
0f3b902
Add comments for Dean + move reload result_handler in generate_native…
pchilano Oct 29, 2024
1b695e5
Fix comment in continuation.hpp
pchilano Oct 30, 2024
9fd4c03
Add klass_name check for is_object_wait0
pchilano Oct 30, 2024
63003d3
Rename oopCont + fix in JvmtiUnmountBeginMark
pchilano Oct 30, 2024
749e30e
Add comment in call_VM_preemptable
pchilano Oct 30, 2024
aa682de
SmallRegisterMap::instance() fix + comment typo
pchilano Oct 30, 2024
0951dfe
Fix typos in comments
pchilano Oct 30, 2024
e342980
Comments for Dean
pchilano Oct 31, 2024
9f086c5
Add ObjectMonitor::successor() method + use ThreadIdentifier::initial()
pchilano Oct 31, 2024
12213a7
Use frame::sender_sp_offset in continuationFreezeThaw_riscv.inline.hpp
pchilano Oct 31, 2024
d09575f
Explicitly pass tmp register to inc/dec_held_monitor_count + use stat…
pchilano Oct 31, 2024
c92cb6b
Comment in FreezeBase::recurse_freeze + renames in continuation.hpp
pchilano Oct 31, 2024
aa263f5
Remove redundant assert in ObjectMonitor::VThreadEpilog
pchilano Oct 31, 2024
7354f60
Remove assignments in preempt_kind enum
pchilano Oct 31, 2024
e5a9ce2
add comment to ThreadService::find_deadlocks_at_safepoint
pchilano Oct 31, 2024
60e4325
Merge branch 'master' into JDK-8338383
pchilano Nov 1, 2024
0f0f71a
Remove oop clearing in transfer_lockstack + pass _barriers as argument
pchilano Nov 1, 2024
dac94da
Add comment in X509TrustManagerImpl.java
pchilano Nov 1, 2024
113fb3d
Fix comments for David
pchilano Nov 1, 2024
33eb638
Revert fixes after 8343132
pchilano Nov 1, 2024
52c2664
Use lazySubmitRunContinuation when blocking
pchilano Nov 1, 2024
9752ece
Remove ThawBase::possibly_adjust_frame()
pchilano Nov 2, 2024
1f3cfce
Fix issue with unmounted virtual thread when dumping heap
pchilano Nov 3, 2024
1139631
Update comment block in objectMonitor.cpp
pchilano Nov 3, 2024
b3de8f6
Use freeze_result consistently
pchilano Nov 4, 2024
fbd43e5
Improve JFR pinned reason in event
pchilano Nov 4, 2024
e18b2be
Revert suggestion to ThawBase::new_stack_frame
pchilano Nov 5, 2024
b6ed182
Rename waitTimeout/set_waitTimeout accessors
pchilano Nov 5, 2024
79189f9
Add oopDesc::has_klass_gap() check
pchilano Nov 5, 2024
81434a2
Fix s390x failures
pchilano Nov 5, 2024
e5c18ba
Fix return miss prediction in generate_native_entry for riscv
pchilano Nov 5, 2024
124efa0
Fixes to JFR metadata.xml
pchilano Nov 5, 2024
c0c7e6c
Use ThreadIdentifier::initial() in ObjectMonitor::owner_from()
pchilano Nov 5, 2024
6a3f5f3
Add ReflectionCallerCacheTest.java to test/jdk/ProblemList-Xcomp.txt
pchilano Nov 6, 2024
2001fba
Update comment for _cont_fastpath
pchilano Nov 6, 2024
89d6dc7
Add --enable-native-access=ALL-UNNAMED to SynchronizedNative.java
pchilano Nov 6, 2024
678676a
Move load of _lock_id in C2_MacroAssembler::fast_lock
pchilano Nov 6, 2024
211c6c8
Use is_top_frame boolean in FreezeBase::check_valid_fast_path()
pchilano Nov 6, 2024
37e3017
Use JvmtiVTMSTransitionDisabler::VTMS_vthread_mount/unmount
pchilano Nov 5, 2024
f27c59c
Add @requires vm.continuations to CancelTimerWithContention.java
pchilano Nov 7, 2024
5210f0c
Merge branch 'master' into JDK-8338383
pchilano Nov 7, 2024
62b16c6
Use get_method_name + copyright revert in jvmtiThreadState.cpp
pchilano Nov 7, 2024
1814e33
Add ObjectWaiter::at_monitorenter
pchilano Nov 8, 2024
3cdb8f8
Fix in JvmtiEnvBase::get_locked_objects_in_frame()
pchilano Nov 8, 2024
3ce6663
Merge branch 'master' into JDK-8338383
pchilano Nov 8, 2024
97a8a82
Pass -XX:-UseCompactObjectHeaders in test JNIMonitor.java
pchilano Nov 11, 2024
5878759
Test StopThreadTest.java: fix operator in condition + improve names
pchilano Nov 11, 2024
0fe6046
Merge branch 'master' into JDK-8338383
pchilano Nov 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/javaThread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class JavaThread: public Thread {
// ID used as owner for inflated monitors. Same as the j.l.Thread.tid of the
// current _vthread object, except during creation of the primordial and JNI
// attached thread cases where this field can have a temporary value. Also,
// calls to VirtualThread.switchToCarrierThread will temporary change _vthread
// calls to VirtualThread.switchToCarrierThread will temporarily change _vthread
// to refer to the carrier while preserving the j.l.Thread.tid of the virtual
// thread in this field.
int64_t _lock_id;
Expand Down
14 changes: 7 additions & 7 deletions src/hotspot/share/runtime/lightweightSynchronizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ ObjectMonitor* LightweightSynchronizer::get_or_insert_monitor_from_table(oop obj
}

ObjectMonitor* alloced_monitor = new ObjectMonitor(object);
alloced_monitor->set_owner_anonymous();
alloced_monitor->set_anonymous_owner();

// Try insert monitor
monitor = add_monitor(current, alloced_monitor, object);
Expand Down Expand Up @@ -741,7 +741,7 @@ void LightweightSynchronizer::exit(oop object, JavaThread* current) {
assert(mark.has_monitor(), "must be");
// The monitor exists
ObjectMonitor* monitor = ObjectSynchronizer::read_monitor(current, object, mark);
if (monitor->has_owner_anonymous()) {
if (monitor->has_anonymous_owner()) {
assert(current->lock_stack().contains(object), "current must have object on its lock stack");
monitor->set_owner_from_anonymous(current);
monitor->set_recursions(current->lock_stack().remove(object) - 1);
Expand Down Expand Up @@ -786,7 +786,7 @@ ObjectMonitor* LightweightSynchronizer::inflate_locked_or_imse(oop obj, ObjectSy
assert(mark.has_monitor(), "must be");
ObjectMonitor* monitor = ObjectSynchronizer::read_monitor(current, obj, mark);
if (monitor != nullptr) {
if (monitor->has_owner_anonymous()) {
if (monitor->has_anonymous_owner()) {
LockStack& lock_stack = current->lock_stack();
if (lock_stack.contains(obj)) {
// Current thread owns the lock but someone else inflated it.
Expand Down Expand Up @@ -834,7 +834,7 @@ ObjectMonitor* LightweightSynchronizer::inflate_into_object_header(oop object, O
ObjectMonitor* inf = mark.monitor();
markWord dmw = inf->header();
assert(dmw.is_neutral(), "invariant: header=" INTPTR_FORMAT, dmw.value());
if (inf->has_owner_anonymous() &&
if (inf->has_anonymous_owner() &&
inflating_thread != nullptr && inflating_thread->lock_stack().contains(object)) {
inf->set_owner_from_anonymous(inflating_thread);
size_t removed = inflating_thread->lock_stack().remove(object);
Expand Down Expand Up @@ -862,7 +862,7 @@ ObjectMonitor* LightweightSynchronizer::inflate_into_object_header(oop object, O
monitor->set_owner(inflating_thread);
} else {
// Owned by somebody else.
monitor->set_owner_anonymous();
monitor->set_anonymous_owner();
}
markWord monitor_mark = markWord::encode(monitor);
markWord old_mark = object->cas_set_mark(monitor_mark, mark);
Expand Down Expand Up @@ -952,7 +952,7 @@ ObjectMonitor* LightweightSynchronizer::inflate_fast_locked_object(oop object, O
// ObjectMonitors are always inserted as anonymously owned, this thread is
// the current holder of the monitor. So unless the entry is stale and
// contains a deflating monitor it must be anonymously owned.
if (monitor->has_owner_anonymous()) {
if (monitor->has_anonymous_owner()) {
// The monitor must be anonymously owned if it was added
assert(monitor == get_monitor_from_table(current, object), "The monitor must be found");
// New fresh monitor
Expand Down Expand Up @@ -1073,7 +1073,7 @@ ObjectMonitor* LightweightSynchronizer::inflate_and_enter(oop object, ObjectSync
// CASE: inflated
if (mark.has_monitor()) {
LockStack& lock_stack = locking_thread->lock_stack();
if (monitor->has_owner_anonymous() && lock_stack.contains(object)) {
if (monitor->has_anonymous_owner() && lock_stack.contains(object)) {
// The lock is fast-locked by the locking thread,
// convert it to a held monitor with a known owner.
monitor->set_owner_from_anonymous(locking_thread);
Expand Down
17 changes: 3 additions & 14 deletions src/hotspot/share/runtime/objectMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1536,23 +1536,12 @@ void ObjectMonitor::ExitEpilog(JavaThread* current, ObjectWaiter* Wakee) {
OM_PERFDATA_OP(Parks, inc());
}

// complete_exit exits a lock returning recursion count
// complete_exit requires an inflated monitor
// The _owner field is not always the Thread addr even with an
// inflated monitor, e.g. the monitor can be inflated by a non-owning
// thread due to contention.
// Exits the monitor returning recursion count. _owner should
// be set to current's tid, i.e. no ANONYMOUS_OWNER allowed.
intx ObjectMonitor::complete_exit(JavaThread* current) {
assert(InitDone, "Unexpectedly not initialized");

if (!has_owner(current)) {
if (LockingMode == LM_LEGACY && has_stack_locker(current)) {
assert(_recursions == 0, "internal state error");
set_owner_from_BasicLock(current); // Convert from BasicLock* to Thread*.
_recursions = 0;
}
}

guarantee(has_owner(current), "complete_exit not owner");

intx save = _recursions; // record the old recursion count
_recursions = 0; // set the recursion level to be 0
exit(current); // exit the monitor
Expand Down
9 changes: 2 additions & 7 deletions src/hotspot/share/runtime/objectMonitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,6 @@ class ObjectMonitor : public CHeapObj<mtObjectMonitor> {
void set_owner_from_raw(int64_t old_value, int64_t new_value);
// Same as above but uses tid of current as new value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By tid here (and elsewhere) you actually mean thread->threadObj()->thread_id() - right?

Copy link
Contributor Author

@pchilano pchilano Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is thread->vthread()->thread_id() but it will match thread->threadObj()->thread_id() when there is no virtual thread mounted. But we cache it in thread->_lockd_id so we retrieve it from there. I think we should probably change the name of _lock_id.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but we can't change it there to thread_id because then it would be too confusing. Since it's used for locking, lock_id seems like a good name.

void set_owner_from(int64_t old_value, JavaThread* current);
// Set _owner field to tid of current thread; current value must be ANONYMOUS_OWNER.
void set_owner_from_BasicLock(JavaThread* current);
// Try to set _owner field to new_value if the current value matches
// old_value, using Atomic::cmpxchg(). Otherwise, does not change the
// _owner field. Returns the prior value of the _owner field.
Expand All @@ -322,17 +320,14 @@ class ObjectMonitor : public CHeapObj<mtObjectMonitor> {
return try_set_owner_from(NO_OWNER, thread) == NO_OWNER;
}

bool has_owner_anonymous() const { return owner_raw() == ANONYMOUS_OWNER; }
void set_owner_anonymous() {
bool has_anonymous_owner() const { return owner_raw() == ANONYMOUS_OWNER; }
void set_anonymous_owner() {
set_owner_from_raw(NO_OWNER, ANONYMOUS_OWNER);
}
void set_owner_from_anonymous(JavaThread* owner) {
set_owner_from(ANONYMOUS_OWNER, owner);
}

// Returns true if BasicLock* stored in _stack_locker
// points to current's stack, false otherwise.
bool has_stack_locker(JavaThread* current);
// Get and set _stack_locker.
BasicLock* stack_locker() const;
void set_stack_locker(BasicLock* locker);
Expand Down
22 changes: 1 addition & 21 deletions src/hotspot/share/runtime/objectMonitor.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ inline int64_t ObjectMonitor::owner_from(oop vthread) {
}

inline bool ObjectMonitor::is_entered(JavaThread* current) const {
if (has_owner_anonymous()) {
if (has_anonymous_owner()) {
if (LockingMode == LM_LIGHTWEIGHT) {
return current->lock_stack().contains(object());
} else {
Expand Down Expand Up @@ -125,10 +125,6 @@ inline void ObjectMonitor::set_stack_locker(BasicLock* locker) {
Atomic::store(&_stack_locker, locker);
}

inline bool ObjectMonitor::has_stack_locker(JavaThread* current) {
return has_owner_anonymous() && current->is_lock_owned((address)stack_locker());
}

// Returns true if owner field == DEFLATER_MARKER and false otherwise.
// This accessor is called when we really need to know if the owner
// field == DEFLATER_MARKER and any non-null value won't do the trick.
Expand Down Expand Up @@ -191,22 +187,6 @@ inline void ObjectMonitor::set_owner_from(int64_t old_value, JavaThread* current
set_owner_from_raw(old_value, owner_from(current));
}

// Simply set _owner to the tid of current. Current owner must be anonymous.
inline void ObjectMonitor::set_owner_from_BasicLock(JavaThread* current) {
BasicLock* basic_lock_p = stack_locker();

set_stack_locker(nullptr); // first
assert(has_owner_anonymous(), "");

// Non-null owner field to non-null owner field is safe without
// cmpxchg() as long as all readers can tolerate either flavor.
Atomic::store(&_owner, owner_from(current));
log_trace(monitorinflation, owner)("set_owner_from_BasicLock(): mid="
INTPTR_FORMAT ", basic_lock_p="
INTPTR_FORMAT ", new_value=" INT64_FORMAT,
p2i(this), p2i(basic_lock_p), owner_from(current));
}

// Try to set _owner field to new_value if the current value matches
// old_value. Otherwise, does not change the _owner field. Returns
// the prior value of the _owner field.
Expand Down
9 changes: 5 additions & 4 deletions src/hotspot/share/runtime/synchronizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ void ObjectSynchronizer::exit_legacy(oop object, BasicLock* lock, JavaThread* cu
// The ObjectMonitor* can't be async deflated until ownership is
// dropped inside exit() and the ObjectMonitor* must be !is_busy().
ObjectMonitor* monitor = inflate(current, object, inflate_cause_vm_internal);
assert(!monitor->has_owner_anonymous(), "must not be");
assert(!monitor->has_anonymous_owner(), "must not be");
monitor->exit(current);
}

Expand Down Expand Up @@ -1464,10 +1464,11 @@ ObjectMonitor* ObjectSynchronizer::inflate_impl(JavaThread* inflating_thread, oo
ObjectMonitor* inf = mark.monitor();
markWord dmw = inf->header();
assert(dmw.is_neutral(), "invariant: header=" INTPTR_FORMAT, dmw.value());
if (inf->has_owner_anonymous() && inflating_thread != nullptr) {
if (inf->has_anonymous_owner() && inflating_thread != nullptr) {
assert(LockingMode == LM_LEGACY, "invariant");
if (inflating_thread->is_lock_owned((address)inf->stack_locker())) {
inf->set_owner_from_BasicLock(inflating_thread);
inf->set_stack_locker(nullptr);
inf->set_owner_from_anonymous(inflating_thread);
}
}
return inf;
Expand Down Expand Up @@ -1555,7 +1556,7 @@ ObjectMonitor* ObjectSynchronizer::inflate_impl(JavaThread* inflating_thread, oo
// Use ANONYMOUS_OWNER to indicate that the owner is the BasicLock on the stack,
// and set the stack locker field in the monitor.
m->set_stack_locker(mark.locker());
m->set_owner_anonymous(); // second
m->set_anonymous_owner(); // second
}
// TODO-FIXME: assert BasicLock->dhw != 0.

Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/threads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ JavaThread* Threads::owning_thread_from_object(ThreadsList * t_list, oop obj) {
}

JavaThread* Threads::owning_thread_from_monitor(ThreadsList* t_list, ObjectMonitor* monitor) {
if (monitor->has_owner_anonymous()) {
if (monitor->has_anonymous_owner()) {
if (LockingMode == LM_LIGHTWEIGHT) {
return owning_thread_from_object(t_list, monitor->object());
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/vmOperations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ class ObjectMonitorsDump : public MonitorClosure, public ObjectMonitorsView {
void do_monitor(ObjectMonitor* monitor) override {
assert(monitor->has_owner(), "Expects only owned monitors");

if (monitor->has_owner_anonymous()) {
if (monitor->has_anonymous_owner()) {
// There's no need to collect anonymous owned monitors
// because the caller of this code is only interested
// in JNI owned monitors.
Expand Down
2 changes: 1 addition & 1 deletion src/java.base/share/classes/java/lang/Thread.java
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ public static void onSpinWait() {}
* Helper class to generate thread identifiers. The identifiers start at
* {@link Thread#PRIMORDIAL_TID}&nbsp;+1 as this class cannot be used during
* early startup to generate the identifier for the primordial thread. The
* counter is off-heap and shared with the VM to allow it assign thread
* counter is off-heap and shared with the VM to allow it to assign thread
* identifiers to non-Java threads.
* See Thread initialization.
*/
Expand Down
14 changes: 7 additions & 7 deletions src/java.base/share/classes/java/lang/VirtualThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -628,15 +628,15 @@ private void afterYield() {

// Object.wait
if (s == WAITING || s == TIMED_WAITING) {
byte nonce;
byte seqNo;
int newState;
if (s == WAITING) {
nonce = 0; // not used
seqNo = 0; // not used
setState(newState = WAIT);
} else {
// synchronize with timeout task (previous timed-wait may be running)
synchronized (timedWaitLock()) {
nonce = ++timedWaitSeqNo;
seqNo = ++timedWaitSeqNo;
setState(newState = TIMED_WAIT);
}
}
Expand All @@ -659,7 +659,7 @@ private void afterYield() {
// schedule wakeup
if (newState == TIMED_WAIT) {
assert waitTimeout > 0;
waitTimeoutTask = schedule(() -> waitTimeoutExpired(nonce), waitTimeout, MILLISECONDS);
waitTimeoutTask = schedule(() -> waitTimeoutExpired(seqNo), waitTimeout, MILLISECONDS);
}
return;
}
Expand Down Expand Up @@ -945,12 +945,12 @@ private void unblock() {
* and submit its task so that it continues and attempts to reenter the monitor.
* This method does nothing if the thread has been woken by notify or interrupt.
*/
private void waitTimeoutExpired(byte nounce) {
private void waitTimeoutExpired(byte seqNo) {
assert !Thread.currentThread().isVirtual();
for (;;) {
boolean unblocked = false;
synchronized (timedWaitLock()) {
if (nounce != timedWaitSeqNo) {
if (seqNo != timedWaitSeqNo) {
// this timeout task is for a past timed-wait
return;
}
Expand Down Expand Up @@ -1394,7 +1394,7 @@ private Object carrierThreadAccessLock() {
}

/**
* Returns a lock object to coordinating timed-wait setup and timeout handling.
* Returns a lock object for coordinating timed-wait setup and timeout handling.
*/
private Object timedWaitLock() {
// use this object for now to avoid the overhead of introducing another lock
Expand Down