refactor: replace unwrap() with expect for mutex locks

Replace all `lock().unwrap()` calls on Mutex guards with explicit error messages using `.expect("... mutex poisoned")`. This improves robustness by providing clear diagnostics when a thread panics while holding the lock, preventing silent failures. Affected modules: events.rs (Renderer/MediaServer), all renderer backends, queue backend/implementation files. Also adds documentation to marker traits (HasQueue、 HasContinuousStream) and clarifies error handling in watcher loop with panic catching.
This commit is contained in:
2026-04-12 19:20:43 +02:00
parent 9e447023a8
commit 4b793cec59
11 changed files with 152 additions and 263 deletions

View File

@@ -6,7 +6,7 @@ mod snapshot;
use std::sync::{Arc, Mutex};
pub use backend::{EnqueueMode, HasQueue, QueueBackend};
pub use backend::{EnqueueMode, QueueBackend};
pub use music_queue::{MusicQueue, SyncScheduleOutcome};
pub use snapshot::{PlaybackItem, QueueSnapshot};