Repository navigation
[macOS] Register the Cocoa main thread at an earlier point - #456
Merged
Merged
Conversation
Solves the issues caused by calling `EventsLoopProxy::wakeup()` too early from a worker thread.
Member
|
Good catch! Thanks. |
Contributor
|
Oh wow, great find! I think remember getting stung by this in the past, thank you for submitting this PR! |
francesca64
added a commit
that referenced
this pull request
Apr 18, 2018
)" This reverts commit 1068891.
yvt
added a commit
to yvt/ngspades
that referenced
this pull request
Apr 25, 2020
Implements a work-around for the issue caused by calling `EventsLoopProxy::wakeup()` too early from a background thread. See: rust-windowing/winit#456
tmfink
pushed a commit
to tmfink/winit
that referenced
this pull request
Jan 5, 2022
simd: Bump rustc_version to 0.3
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.
Solves the issues caused by calling
EventsLoopProxy::wakeup()too early from a worker thread.A global singleton instance of
NSApplicationis created when[NSApplication sharedApplication]is called for the first time. When this happens, the calling thread is registered as the main thread. This means that the main thread in a Cocoa application is determined when the application calls it for the first time.EventsLoopProxy::wakeupcalls it internally. As a result, if you callEventsLoopProxy::wakeupvery early, a wrong thread will be registered as the main thread, causing the application to misbehave. The framework detects such situations and generates the following log output:This PR fixes this issue by calling
[NSApplication sharedApplication]fromEventsLoop::new().