os_sync/
lib.rs

1//! Simple synchronization primitives based on OS semaphore.
2
3#![no_std]
4#![warn(missing_docs)]
5#![cfg_attr(feature = "cargo-clippy", allow(clippy::style))]
6
7#[cfg(not(debug_assertions))]
8macro_rules! unreach {
9    () => ({
10        unsafe {
11            core::hint::unreachable_unchecked();
12        }
13    })
14}
15
16#[cfg(debug_assertions)]
17macro_rules! unreach {
18    () => ({
19        unreachable!()
20    })
21}
22
23mod sem;
24pub use sem::{Sem, Semaphore, SemaphoreGuard};
25
26mod once;
27pub use once::Once;
28
29pub mod mutex;
30pub use mutex::Mutex;
31///Alias to [SemMutex](mutex/struct.SemMutex.html) with default [Semaphore](sem/trait.Semaphore.html) implementation
32pub type SemMutex = mutex::SemMutex<Sem>;