File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -429,7 +429,7 @@ mod tests {
429429 assert_not_impl_any ! ( WaylandWindowHandle : Send , Sync ) ;
430430 assert_impl_all ! ( DrmWindowHandle : Send , Sync ) ;
431431 assert_not_impl_any ! ( GbmWindowHandle : Send , Sync ) ;
432- assert_not_impl_any ! ( Win32WindowHandle : Send , Sync ) ;
432+ assert_impl_all ! ( Win32WindowHandle : Send , Sync ) ;
433433 assert_not_impl_any ! ( WinRtWindowHandle : Send , Sync ) ;
434434 assert_not_impl_any ! ( WebCanvasWindowHandle : Send , Sync ) ;
435435 assert_not_impl_any ! ( WebOffscreenCanvasWindowHandle : Send , Sync ) ;
Original file line number Diff line number Diff line change @@ -55,13 +55,17 @@ pub struct Win32WindowHandle {
5555 pub hinstance : Option < NonNull < c_void > > ,
5656}
5757
58+ unsafe impl Send for Win32WindowHandle { }
59+ unsafe impl Sync for Win32WindowHandle { }
60+
5861impl Win32WindowHandle {
5962 /// Create a new handle to a window.
6063 ///
6164 /// # Safety
6265 ///
63- /// It is assumed that the Win32 handle belongs to the current thread. This
64- /// is necessary for the handle to be considered "valid" in all cases.
66+ /// Some APIs taking a `HWND` must observe its thread-affinity.
67+ /// Consumers are responsible to ensure these safety guarantees themselves.
68+ /// See [`GetWindowThreadProcessId()`](https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowthreadprocessid).
6569 ///
6670 /// # Example
6771 ///
You can’t perform that action at this time.
0 commit comments