1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Synchronization primitives that have both synchronous and asynchronous variants under the same
//! interface.

#[cfg(feature = "__sync")]
mod blocking;
#[cfg(feature = "__async")]
mod futures;

#[cfg(feature = "__sync")]
use self::blocking as imp;
#[cfg(feature = "__async")]
use self::futures as imp;

/// A type alias for either an asynchronous mutex or [`std::sync::Mutex`], depending on whether
/// this library is compiled in asynchronous or synchronous mode.
pub type Mutex<T> = imp::Mutex<T>;