fix(audio): replace Mutex unwrap with poisoned-mutex recovery (TODO-006)
Replace 42 .lock().unwrap() calls with .unwrap_or_else(|e| e.into_inner()) across 7 files. Poisoned mutex recovery prevents panics in realtime audio callbacks. Add SAFETY comment to WebRtcFallbackVad Send impl (TODO-007).
This commit is contained in:
@@ -543,7 +543,7 @@ impl DesktopPttBackend for MacOSEventTapBackend {
|
||||
}
|
||||
let runloop = unsafe { CFRunLoopGetCurrent() };
|
||||
{
|
||||
let mut g = worker_runloop.lock().unwrap();
|
||||
let mut g = worker_runloop.lock().unwrap_or_else(|e| e.into_inner());
|
||||
*g = Some(RunLoopHandle(runloop));
|
||||
}
|
||||
unsafe {
|
||||
|
||||
Reference in New Issue
Block a user