Repository navigation
Broadcast when wait() releases the monitor, so a thread entering wakes - #21
Merged
Merged
Conversation
wait(J) and wait0(J) give up the monitor and wake one thread on its condition variable, which threads entering share with threads in wait(). When that wakeup lands on another wait(), the thread entering sleeps at the door of a free monitor until the other wait times out. This is the same lost wakeup PR #20 fixed in monitor-exit; broadcast here too. The new aaa/waitwake.java enters after ~5000 ms without the fix (3/3) and immediately with it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
atgreen
added a commit
that referenced
this pull request
Oct 20, 2026
PRs #19-#21 and #23-#27 added aaa/jitwake, monitorwake, waitwake, zipfile, filestat, lazyloader, reflstatic, siblingloaders and childfirst. check-regression.sh only fails on lost passes and new failures, so a new test is not enforced until it is in the baseline. Core suites now 528 expected passes, up from 501; no test changed state. Generated with make check-regression at 2e5e6db; the Running lines keep the existing baseline's paths. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
wait(J)(src/native/support.lisp) andwait0(J)(src/native/threads.lisp, the one JDK 21+ uses) give up the monitor and wake one thread withcondition-notify, on the monitor's condition variable, which threads entering share with threads inwait(). When that wakeup lands on anotherwait(), that thread sees it is still in the wait set and goes back to sleep, and the thread entering stays asleep at a free monitor until the other wait times out.This is the same lost wakeup #20 fixed in
monitor-exit, so this makes both sitessb-thread:condition-broadcastas well. Every waiting loop already re-checks its condition (owner or wait-set membership), so the extra wakeups are harmless.Checks: the new
aaa/waitwake.javahas a thread inwait(5000), a holder that enters and then callswait(5000)itself, and a third thread blocked entering. Without the fix the third thread entered after ~5000 ms, three runs out of three (slow after 5000 ms); with it,OKthree out of three. It also printsOKon the reference JVM.aaa/monitorwake.javastill passes. I couldn't runmake check-regressionlocally (no DejaGnu here), so CI's regression gate is the full check.🤖 Generated with Claude Code