You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HWND used to be a wrapper of isize, like HWND(pub isize), this meant it was also Send+Sync.
Now that HWND is:
pub struct HWND(pub *mut core::ffi::c_void);
It means it's not automatically Sync + Send. I don't see why it couldn't be Sync+Send because HWNDs are single-use values, and multiple threads and processes already use them.
My suggestion is to do this:
unsafe impl Sync for HWND {}
unsafe impl Send for HWND {}
Maybe for other handles as well?
The text was updated successfully, but these errors were encountered:
This has been discussed in #3169. In a nutshell, handles are used in too many different ways to mark them all as Send and Sync. As an example, DestroyWindow cannot be called from a thread other than the window's owning thread.
Suggestion
HWND used to be a wrapper of
isize
, likeHWND(pub isize)
, this meant it was also Send+Sync.Now that HWND is:
It means it's not automatically Sync + Send. I don't see why it couldn't be Sync+Send because HWNDs are single-use values, and multiple threads and processes already use them.
My suggestion is to do this:
Maybe for other handles as well?
The text was updated successfully, but these errors were encountered: