mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-23 02:16:33 +11:00
macOS/iOS: Fix auto trait impls of EventLoopProxy
(#1084)
* macOS/iOS: Fix auto trait impls of `EventLoopProxy` `EventLoopProxy<T>` allows sending `T` from an arbitrary thread that owns the proxy object. Thus, if `T` is `!Send`, `EventLoopProxy<T>` must not be allowed to leave the main thread. `EventLoopProxy<T>` uses `std::sync::mpsc::Sender` under the hood, meaning the `!Sync` restriction of it also applies to `EventLoopProxy<T>`. That is, even if `T` is thread-safe, a single `EventLoopProxy` object cannot be shared between threads. * Update `CHANGELOG.md`
This commit is contained in:
parent
30b4f8dc9f
commit
31ada5a052
3 changed files with 4 additions and 5 deletions
|
@ -21,6 +21,7 @@
|
|||
- On Linux, the functions `is_wayland`, `is_x11`, `xlib_xconnection` and `wayland_display` have been moved to a new `EventLoopWindowTargetExtUnix` trait.
|
||||
- On iOS, add `set_prefers_status_bar_hidden` extension function instead of
|
||||
hijacking `set_decorations` for this purpose.
|
||||
- On macOS and iOS, corrected the auto trait impls of `EventLoopProxy`.
|
||||
|
||||
# 0.20.0 Alpha 2 (2019-07-09)
|
||||
|
||||
|
|
|
@ -142,8 +142,7 @@ pub struct EventLoopProxy<T> {
|
|||
source: CFRunLoopSourceRef,
|
||||
}
|
||||
|
||||
unsafe impl<T> Send for EventLoopProxy<T> {}
|
||||
unsafe impl<T> Sync for EventLoopProxy<T> {}
|
||||
unsafe impl<T: Send> Send for EventLoopProxy<T> {}
|
||||
|
||||
impl<T> Clone for EventLoopProxy<T> {
|
||||
fn clone(&self) -> EventLoopProxy<T> {
|
||||
|
|
|
@ -113,8 +113,7 @@ pub struct Proxy<T> {
|
|||
source: CFRunLoopSourceRef,
|
||||
}
|
||||
|
||||
unsafe impl<T> Send for Proxy<T> {}
|
||||
unsafe impl<T> Sync for Proxy<T> {}
|
||||
unsafe impl<T: Send> Send for Proxy<T> {}
|
||||
|
||||
impl<T> Clone for Proxy<T> {
|
||||
fn clone(&self) -> Self {
|
||||
|
|
Loading…
Add table
Reference in a new issue