async_priority_lock/lib.rs
1//! # Async Priority Lock
2//! Primitives for priority-sorted synchronization of resources.
3//!
4//! Permits / lock guards are granted in order of priority, with the option to request
5//! eviction when the `evict` flag is enabled.
6//!
7//! All [Future]s are cancel-safe.
8//!
9#![doc = include_str!("../feature-table.md")]
10//!
11//! Interrupt / signal safety: operations affecting the internal queues (such as
12//! locking or releasing) are not safe to call in parallel on the same thread.
13//!
14//! i.e.: a deadlock may occur if the acquisition or dropping of a guard is interrupted, and the same
15//! thread goes on to acquire or drop a guard from the same [Mutex] / [Semaphore].
16//!
17//! If this is non-desireable / will cause issues, feel free to create an issue.
18//!
19#![doc = include_str!("../CHANGELOG.md")]
20#![cfg_attr(not(feature = "std"), no_std)]
21
22mod internal;
23use internal::*;
24mod waiter;
25
26#[cfg(all(doc, feature = "alloc"))]
27extern crate alloc;
28
29pub mod priority;
30pub use priority::*;
31
32pub mod queue;
33
34#[cfg(feature = "mutex")]
35pub mod mutex;
36#[cfg(feature = "mutex")]
37pub use mutex::*;
38
39#[cfg(feature = "semaphore")]
40pub mod semaphore;
41#[cfg(feature = "semaphore")]
42pub use semaphore::*;