[CoreCLR] Complete startup-aware lock initialization#12219
Open
jonathanpeppers wants to merge 3 commits into
Open
[CoreCLR] Complete startup-aware lock initialization#12219jonathanpeppers wants to merge 3 commits into
jonathanpeppers wants to merge 3 commits into
Conversation
Mark CoreCLR startup complete after managed runtime initialization so lazy assembly and DSO operations use their synchronization primitives. Add a concurrent cold-start assembly decompression stress test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7bf1a651-5488-4ef9-92e6-863f27e23da5
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7bf1a651-5488-4ef9-92e6-863f27e23da5
Remove the CoreCLR-only comment so the startup completion call mirrors the existing Mono implementation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7bf1a651-5488-4ef9-92e6-863f27e23da5
Contributor
There was a problem hiding this comment.
Pull request overview
Ensures CoreCLR’s runtime initialization correctly transitions out of “startup in progress” so StartupAwareLock begins acquiring mutexes after successful managed initialization, matching Mono’s lifecycle behavior and fixing missing synchronization for post-startup lazy init paths.
Changes:
- Include
runtime-base/monodroid-state.hhin CoreCLR host initialization code. - Call
MonodroidState::mark_startup_done ()at the end of successfulJava_mono_android_Runtime_initInternal.
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.
Context
Mono marks runtime startup complete at the end of successful initialization by calling
MonodroidState::mark_startup_done().CoreCLR had the same
MonodroidStateimplementation, but its initialization function returned without callingmark_startup_done(). Consequently,StartupAwareLockcontinued treating the process as single-threaded startup and never acquired its mutexes after initialization.This affects synchronization for lazy assembly decompression and DSO handle initialization.
Change
Call
MonodroidState::mark_startup_done()at the end of successful CoreCLR managed initialization, after returned JNI function pointers are published and final startup timing events complete. This mirrors Mono's placement and comment style; Mono has no comment on the transition, so none is added here.Testing
arm64-v8a,armeabi-v7a,x86_64, andx86.C:.