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
|
|
@ -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
Add a link
Reference in a new issue