blob: e2751be0ec3e4b8a309bb9a80c3d5a88619f6732 [file]
/// A macro that allows working with std and spin Mutexes
/// when you're ok panicking on a poisoned Mutex.
#[cfg(all(feature = "std", not(single_threaded)))]
#[macro_export]
macro_rules! panic_if_poisoned {
( $poisonable:expr ) => {
$poisonable.unwrap()
};
}
/// A macro that allows working with std and spin Mutexes
/// when you're ok panicking on a poisoned Mutex.
#[cfg(single_threaded)]
#[macro_export]
macro_rules! panic_if_poisoned {
( $unpoisonable:expr ) => {
// spin::Mutex does not support poisoning and returns
// a MutexGuard directly
$unpoisonable
};
}