Skip to content
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

Update Continuation.yield to use onPinned API #16024

Merged
merged 1 commit into from
Oct 3, 2022

Conversation

fengxue-IS
Copy link
Contributor

@fengxue-IS fengxue-IS commented Oct 1, 2022

Continuation class implementation expects IllegalStateException when
yielding a pinned Continuation. But VirtualThread class overrides
this behaviour and only returns false without throwing the exception
when yield fails.

  • Allow the overriden onPinned method to perform non-throw behaviour
    when the Continuation is pinned during yield.
  • Update VirtualThread tests on new behaviour.

Rework of #15996

Signed-off-by: Jack Lu Jack.S.Lu@ibm.com

@fengxue-IS fengxue-IS added the project:loom Used to track Project Loom related work label Oct 1, 2022
@fengxue-IS
Copy link
Contributor Author

The failure seen in #16011 is due to VirtualThreadTest expected IllegalStateException when yielding a pinned Continuation, the VirtualThread class extended Continuation class with VThreadContinuation which override that behaviour to only return false without exception when yield fails.

@fengxue-IS
Copy link
Contributor Author

this should be tested/merged after #16025 to ensure test coverage

@babsingh
Copy link
Contributor

babsingh commented Oct 2, 2022

jenkins test sanity amac,zlinux,win,xlinux,aix jdk19

@fengxue-IS
Copy link
Contributor Author

PR build result: https://openj9-jenkins.osuosl.org/job/PullRequest-OpenJ9/2794/
Squashed commits, added details to commit message, fix comment format as suggested

@fengxue-IS
Copy link
Contributor Author

@babsingh can you please take another look

Continuation class implementation expects IllegalStateException when
yielding a pinned Continuation. But VirtualThread class overrides
this behaviour and only returns false without throwing the exception
when yield fails.

- Allow the overriden onPinned method to perform non-throw behaviour
when the Continuation is pinned during yield.
- Update VirtualThread tests on new behaviour

Signed-off-by: Jack Lu <Jack.S.Lu@ibm.com>
@babsingh babsingh merged commit c11c5f0 into eclipse-openj9:master Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project:loom Used to track Project Loom related work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants