Skip to content

Commit c74c7a1

Browse files
docs: correct Session SAFETY comment after crossbeam swap
`crossbeam_channel::Receiver<T>` is `Sync` (unlike `mpsc::Receiver`), so the old "Receiver is `Send` but `!Sync`" justification no longer matched the truth — `Session` is `!Sync` because of its `NonNull<…>` field, not its receiver. Rewrite the SAFETY comment accordingly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 662e354 commit c74c7a1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • crates/wisp-audiokit/src

crates/wisp-audiokit/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ mod imp {
8888

8989
// SAFETY: Session owns the C handle and the receiver. The handle is
9090
// an opaque pointer we never deref ourselves; the C side serializes
91-
// access internally. The receiver is `Send` but `!Sync`, which matches
92-
// the semantics we expose.
91+
// access internally, so it is sound to move the handle across threads.
92+
// (`Session` stays `!Sync` overall because the `NonNull` field is
93+
// `!Sync` — only `Send` needs the manual impl.)
9394
unsafe impl Send for Session {}
9495

9596
// Swift may invoke `on_result_thunk` / `on_log_thunk` from different

0 commit comments

Comments
 (0)