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

sync: adds Notify for basic task notification #2210

Merged
merged 16 commits into from
Feb 26, 2020
Merged
1 change: 1 addition & 0 deletions tokio/src/loom/std/mod.rs
Original file line number Diff line number Diff line change
@@ -64,6 +64,7 @@ pub(crate) mod sync {
pub(crate) use crate::loom::std::atomic_u64::AtomicU64;
pub(crate) use crate::loom::std::atomic_usize::AtomicUsize;

pub(crate) use std::sync::atomic::AtomicU8;
pub(crate) use std::sync::atomic::{fence, AtomicPtr};
pub(crate) use std::sync::atomic::{spin_loop_hint, AtomicBool};
}
2 changes: 1 addition & 1 deletion tokio/src/macros/pin.rs
Original file line number Diff line number Diff line change
@@ -140,5 +140,5 @@ macro_rules! pin {
let $x = $init;
crate::pin!($x);
)*
};
}
carllerche marked this conversation as resolved.
Show resolved Hide resolved
}
12 changes: 12 additions & 0 deletions tokio/src/sync/mod.rs
Original file line number Diff line number Diff line change
@@ -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;
Loading