lingara-embed 0.3.0-alpha.2

Lingara inside a game: the player-side core every engine kit wraps. One I/O thread, a polled event queue, practice and NPC dialogue.
Documentation
1
2
3
4
5
6
7
8
9
//! A poisoned lock is recovered, never propagated: a panic on one task is
//! reported once as `Closed { Internal }` (D2), and must not turn every
//! later engine-thread call into a second panic.

use std::sync::{Mutex, MutexGuard, PoisonError};

pub(crate) fn lock<T>(m: &Mutex<T>) -> MutexGuard<'_, T> {
    m.lock().unwrap_or_else(PoisonError::into_inner)
}