macOS/iOS main thread safety #2464
Labels
B - bug
Dang, that shouldn't have happened
DS - ios
DS - macos
S - enhancement
Wouldn't this be the coolest?
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
: AllowCell
in instance variables so that we don't need to use&mut self
Encode
andRefEncode
forUnsafeCell
andCell
madsmtm/objc2#351winit
through the XCode tools Thread Sanitizer and Main Thread CheckerWinitWindow
requires running on the main thread first.MainThreadBound
madsmtm/objc2#344objc2
AppState
/HANDLER
struct into the main-thread onlyApplicationDelegate
.HANDLER
andAppState
#3389MonitorHandle
andFullscreen
Send + Sync
.HasWindowHandle::window_handle
return an error when not on the main thread.The text was updated successfully, but these errors were encountered: