Skip to content

Commit

Permalink
Rephrase safety comment to avoid talking about the history of the win…
Browse files Browse the repository at this point in the history
…dows-sys crate.
  • Loading branch information
Jan Danielsson committed Dec 20, 2024
1 parent a134848 commit 0527129
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/stream/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,10 @@ struct EventHandle {
state: EventHandleState,
}

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

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

0 comments on commit 0527129

Please sign in to comment.