From 0bf4a78ec526e56075ea413bbd269cee866095c6 Mon Sep 17 00:00:00 2001 From: fufesou Date: Sun, 13 Sep 2026 10:30:12 +0800 Subject: [PATCH] Explain WASAPI self-join handling and shared event lifetime --- src/host/wasapi/stream.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/host/wasapi/stream.rs b/src/host/wasapi/stream.rs index c558a8c..cd3cf52 100644 --- a/src/host/wasapi/stream.rs +++ b/src/host/wasapi/stream.rs @@ -177,6 +177,9 @@ impl Drop for Stream { fn drop(&mut self) { let _ = self.push_command(Command::Terminate); if let Some(thread) = self.thread.take() { + // Prevent self-join: Terminate was sent; the thread exits after the current callback + // returns. Shared event ownership keeps the handle alive until both Stream and + // RunContext release it. if thread.thread().id() != thread::current().id() { let _ = thread.join(); }