diff options
author | Carl Lerche <me@carllerche.com> | 2020-03-26 12:23:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-26 12:23:12 -0700 |
commit | 1cb1e291c10adf6b4e530cb1475b95ba10fa615f (patch) | |
tree | aabaebe663e2647fb72cb609d1486adcde0c4cc4 /tokio/src/sync/task | |
parent | 186196b911bb7cbbd67e74b4ef051d3daf2d64c1 (diff) |
rt: track loom changes + tweak queue (#2315)
Loom is having a big refresh to improve performance and tighten up the
concurrency model. This diff tracks those changes.
Included in the changes is the removal of `CausalCell` deferred checks.
This is due to it technically being undefined behavior in the C++11
memory model. To address this, the work-stealing queue is updated to
avoid needing this behavior. This is done by limiting the queue to have
one concurrent stealer.
Diffstat (limited to 'tokio/src/sync/task')
-rw-r--r-- | tokio/src/sync/task/atomic_waker.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tokio/src/sync/task/atomic_waker.rs b/tokio/src/sync/task/atomic_waker.rs index 127eed35..73b1745f 100644 --- a/tokio/src/sync/task/atomic_waker.rs +++ b/tokio/src/sync/task/atomic_waker.rs @@ -1,6 +1,6 @@ #![cfg_attr(any(loom, not(feature = "sync")), allow(dead_code, unreachable_pub))] -use crate::loom::cell::CausalCell; +use crate::loom::cell::UnsafeCell; use crate::loom::sync::atomic::{self, AtomicUsize}; use std::fmt; @@ -24,7 +24,7 @@ use std::task::Waker; /// `wake`. pub(crate) struct AtomicWaker { state: AtomicUsize, - waker: CausalCell<Option<Waker>>, + waker: UnsafeCell<Option<Waker>>, } // `AtomicWaker` is a multi-consumer, single-producer transfer cell. The cell @@ -137,7 +137,7 @@ impl AtomicWaker { pub(crate) fn new() -> AtomicWaker { AtomicWaker { state: AtomicUsize::new(WAITING), - waker: CausalCell::new(None), + waker: UnsafeCell::new(None), } } |