diff options
author | Carl Lerche <me@carllerche.com> | 2020-02-26 11:40:10 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-26 11:40:10 -0800 |
commit | 8b7ea0ff5cad2522d3113b77e9b6d95b507dee3b (patch) | |
tree | 82e5bb8cb6f67a07f934d03728dace58330b9604 /tokio/src/sync/mod.rs | |
parent | 7207bf355e2b6418bb0d757859a5cdcdedf32530 (diff) |
sync: adds Notify for basic task notification (#2210)
`Notify` provides a synchronization primitive similar to thread park /
unpark, except for tasks.
Diffstat (limited to 'tokio/src/sync/mod.rs')
-rw-r--r-- | tokio/src/sync/mod.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tokio/src/sync/mod.rs b/tokio/src/sync/mod.rs index 7f72bc90..5d7b29ae 100644 --- a/tokio/src/sync/mod.rs +++ b/tokio/src/sync/mod.rs @@ -406,9 +406,18 @@ //! * [`Mutex`][Mutex] Mutual Exclusion mechanism, which ensures that at most //! one thread at a time is able to access some data. //! +//! * [`Notify`][Notify] Basic task notification. `Notify` supports notifying a +//! receiving task without sending data. In this case, the task wakes up and +//! resumes processing. +//! //! * [`RwLock`][RwLock] Provides a mutual exclusion mechanism which allows //! multiple readers at the same time, while allowing only one writer at a //! time. In some cases, this can be more efficient than a mutex. +//! +//! * [`Semaphore`][Semaphore] Limits the amount of concurrency. A semaphore +//! holds a number of permits, which tasks may request in order to enter a +//! critical section. Semaphores are useful for implementing limiting of +//! bounding of any kind. cfg_sync! { mod barrier; @@ -421,6 +430,9 @@ cfg_sync! { mod mutex; pub use mutex::{Mutex, MutexGuard}; + mod notify; + pub use notify::Notify; + pub mod oneshot; pub(crate) mod semaphore_ll; |