Skip to content

Commit 0527129

Browse files
author
Jan Danielsson
committed
Rephrase safety comment to avoid talking about the history of the windows-sys crate.
1 parent a134848 commit 0527129

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/stream/windows.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ struct EventHandle {
7373
state: EventHandleState,
7474
}
7575

76-
// SAFETY: EventHandle is Send automatically if not for HANDLE, which is a [non-autotrait'ed] pointer since windows-sys was updated to 0.59.
77-
// The capture device owns the original handle,
78-
// As long as the capture device isn't released before the EventHandle, this should be good.
76+
// SAFETY: EventHandle needs to be Send because it's passed over a thread boundary.
77+
// It contains a HANDLE that is a raw pointer, so the Send autotrait doesn't apply.
78+
// The capture device owns the original handle; as long as the capture device isn't
79+
// released before the EventHandle, this should be good.
7980
unsafe impl Send for EventHandle {}
8081

8182
/// Newtype used to wrap `HANDLE` to make it `Send`:able

0 commit comments

Comments
 (0)