diff options
author | Matthias Einwag <matthias.einwag@live.com> | 2020-05-02 14:19:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-02 14:19:28 -0700 |
commit | 187af2e6a323be4193c82ad95f9aa32d2ae16869 (patch) | |
tree | 1c7ffff79471905383b74aad7abcfcfc3e6e2b28 /tokio/src/util/mod.rs | |
parent | 31315b94638d8d5912c5f8321d365fd6a210a060 (diff) |
sync: add CancellationToken (#2263)
As a first step towards structured concurrency, this change adds a
CancellationToken for graceful cancellation of tasks.
The task can be awaited by an arbitrary amount of tasks due to the usage
of an intrusive list.
The token can be cloned. In addition to this child tokens can be derived.
When the parent token gets cancelled, all child tokens will also get
cancelled.
Diffstat (limited to 'tokio/src/util/mod.rs')
-rw-r--r-- | tokio/src/util/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tokio/src/util/mod.rs b/tokio/src/util/mod.rs index a093395c..8194dbaf 100644 --- a/tokio/src/util/mod.rs +++ b/tokio/src/util/mod.rs @@ -22,3 +22,5 @@ cfg_rt_threaded! { #[cfg(any(feature = "macros", feature = "stream"))] #[cfg_attr(not(feature = "macros"), allow(unreachable_pub))] pub use rand::thread_rng_n; + +pub(crate) mod intrusive_double_linked_list; |