mirror of
https://github.com/storytold/winit.git
synced 2026-11-22 20:30:44 +01:00
Improve macOS/iOS/Web thread safety
Co-authored-by: daxpedda <daxpedda@gmail.com>
This commit is contained in:
1 parent
65c2482d74
commit
4e6ce00ec5
20 files changed
+552
-724
No files matched your search
@@ -797,6 +797,14 @@ impl Window {
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) fn maybe_queue_on_main(&self, f: impl FnOnce(&Self) + Send + 'static) {
|
||||
f(self)
|
||||
}
|
||||
|
||||
pub(crate) fn maybe_wait_on_main<R: Send>(&self, f: impl FnOnce(&Self) -> R + Send) -> R {
|
||||
f(self)
|
||||
}
|
||||
|
||||
pub fn id(&self) -> WindowId {
|
||||
WindowId
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user