Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(maitake): add wait::Semaphore #301

Merged
merged 14 commits into from
Aug 30, 2022
7 changes: 6 additions & 1 deletion maitake/src/wait.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
//! Waiter cells and queues to allow tasks to wait for notifications.
//!
//! This module implements three types of structure for waiting:
//! This module implements the following primitives for waiting:
//!
//! - [`WaitCell`], which stores a *single* waiting task
//! - [`WaitQueue`], a queue of waiting tasks, which are woken in first-in,
//! first-out order
//! - [`WaitMap`], a set of waiting tasks associated with keys, in which a task
//! can be woken by its key
//! - [`Semaphore`]: an asynchronous [counting semaphore], for limiting the
//! number of tasks which may run concurrently
pub(crate) mod cell;
pub mod map;
pub mod queue;
pub mod semaphore;

pub use self::cell::WaitCell;
#[doc(inline)]
pub use self::map::WaitMap;
#[doc(inline)]
pub use self::queue::WaitQueue;
#[doc(inline)]
pub use self::semaphore::Semaphore;

use core::task::Poll;

Expand Down
Loading