-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
B - bugDang, that shouldn't have happenedDang, that shouldn't have happenedDS - appkitAffects the AppKit/macOS backendAffects the AppKit/macOS backendDS - uikitAffects the UIKit backend (iOS, tvOS, watchOS, visionOS)Affects the UIKit backend (iOS, tvOS, watchOS, visionOS)S - enhancementWouldn't this be the coolest?Wouldn't this be the coolest?
Description
macOS and iOS have the pervasive concept of "main thread safety", which essentially just means that every UI operation has to happen on the main thread. We have some support for this in macos::util::async, but this has been developed more on a case-by-case basis, which is not the way to do thread safety; remember, it is not just certain APIs that are thread unsafe, and the rest are fine, every API is thread unsafe unless documented otherwise!
TODO
-
objc2: AllowCellin instance variables so that we don't need to use&mut self - Run
winitthrough the XCode tools Thread Sanitizer and Main Thread Checker - Make some mechanism so that every call on
WinitWindowrequires running on the main thread first. - Use the above improvements to
objc2 - Move things from the global
AppState/HANDLERstruct into the main-thread onlyApplicationDelegate. - Make
MonitorHandleandFullscreenSend + Sync. - Make
HasWindowHandle::window_handlereturn an error when not on the main thread.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
B - bugDang, that shouldn't have happenedDang, that shouldn't have happenedDS - appkitAffects the AppKit/macOS backendAffects the AppKit/macOS backendDS - uikitAffects the UIKit backend (iOS, tvOS, watchOS, visionOS)Affects the UIKit backend (iOS, tvOS, watchOS, visionOS)S - enhancementWouldn't this be the coolest?Wouldn't this be the coolest?