-
Notifications
You must be signed in to change notification settings - Fork 767
Set blockPermit for BLOCKING thread when lock is free #22215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
66d42ef
to
d30be2e
Compare
runtime/vm/ContinuationHelpers.cpp
Outdated
{ | ||
omrthread_monitor_t monitor = syncObjectMonitor->monitor; | ||
/* Only set the VirtualThread.blockPermit if thread is ready to be unblocked. | ||
* All blocking/waiting monitor have to be inflated, if the monitor has not been inflated, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update. the comment here to reflect only blocking/blocked need this check. also include that the BLOCKPERMIT
will allow afterYield()
function to reschedule the thread.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the comments for BLOCKED and BLOCKING.
d30be2e
to
133d822
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nits.
0d240be
to
0c50040
Compare
Thanks @babsingh I updated the code with your suggestions and fixed additional similar cases. |
@theresa-m Can you squash the commits? The second commit has incorrect details: |
Only set VirtualThread.blockPermit for a virtual thread in the BLOCKING state when the lock is available. This prevents virtual threads from being unblocked prematurely. Signed-off-by: Theresa Mammarella <[email protected]>
0c50040
to
b9639a8
Compare
Done |
jenkins test sanity amac jdk24 |
Only set VirtualThread.blockPermit for a virtual thread in the BLOCKING state when the lock is available. This prevents virtual threads from being unblocked prematurely.
Fixes: #22077
Grinder: https://hyc-runtimes-jenkins.swg-devops.com/view/Test_grinder/job/Grinder/52611/