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

Return true from Unsafe.shouldBeInitialized when called from <clinit> #18719

Merged
merged 1 commit into from
Jan 10, 2024

Conversation

jdmpapin
Copy link
Contributor

@jdmpapin jdmpapin commented Jan 9, 2024

When initialization of the class has started but not yet completed, and shouldBeInitialized is called from the initializing thread, its result should be true, but it has been returning false instead.

DirectMethodHandle.checkInitialized calls ensureClassInitialized and then uses this method to determine whether initialization is incomplete because it is still ongoing on the current thread. This fix should allow that usage to work as intended.

When initialization of the class has started but not yet completed, and
shouldBeInitialized is called from the initializing thread, its result
should be true, but it has been returning false instead.

DirectMethodHandle.checkInitialized calls ensureClassInitialized and
then uses this method to determine whether initialization is incomplete
because it is still ongoing on the current thread. This fix should allow
that usage to work as intended.
@jdmpapin jdmpapin requested a review from babsingh January 9, 2024 23:55
@babsingh
Copy link
Contributor

jenkins test sanity.functional,sanity.openjdk alinux jdk21

@babsingh
Copy link
Contributor

@babsingh babsingh merged commit 1cf0141 into eclipse-openj9:master Jan 10, 2024
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants