diff options
| author | Ben Blum <bblum@andrew.cmu.edu> | 2013-07-31 15:56:18 -0400 |
|---|---|---|
| committer | Ben Blum <bblum@andrew.cmu.edu> | 2013-08-01 16:52:37 -0400 |
| commit | 880246618b6c28adc76e5e68247aa5a9302320f8 (patch) | |
| tree | 0e78b928d7fdc3483213d39813eb91af1c8c1caf /src/libstd/rt/comm.rs | |
| parent | 479809a267dbbcc3e2ec87da677c63430d3d229a (diff) | |
| download | rust-880246618b6c28adc76e5e68247aa5a9302320f8.tar.gz rust-880246618b6c28adc76e5e68247aa5a9302320f8.zip | |
Relax some atomic barriers. Loosen up all that tension. There, doesn't that feel good?
Diffstat (limited to 'src/libstd/rt/comm.rs')
| -rw-r--r-- | src/libstd/rt/comm.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstd/rt/comm.rs b/src/libstd/rt/comm.rs index a27ff559b2b..11ba42f805b 100644 --- a/src/libstd/rt/comm.rs +++ b/src/libstd/rt/comm.rs @@ -18,7 +18,7 @@ use kinds::Send; use rt::sched::Scheduler; use rt::local::Local; use rt::select::{Select, SelectPort}; -use unstable::atomics::{AtomicUint, AtomicOption, Acquire, Release, SeqCst}; +use unstable::atomics::{AtomicUint, AtomicOption, Acquire, Relaxed, SeqCst}; use unstable::sync::UnsafeAtomicRcBox; use util::Void; use comm::{GenericChan, GenericSmartChan, GenericPort, Peekable}; @@ -216,15 +216,15 @@ impl<T> Select for PortOne<T> { } STATE_ONE => { // Re-record that we are the only owner of the packet. - // Release barrier needed in case the task gets reawoken - // on a different core (this is analogous to writing a - // payload; a barrier in enqueueing the task protects it). + // No barrier needed, even if the task gets reawoken + // on a different core -- this is analogous to writing a + // payload; a barrier in enqueueing the task protects it. // NB(#8132). This *must* occur before the enqueue below. // FIXME(#6842, #8130) This is usually only needed for the // assertion in recv_ready, except in the case of select(). // This won't actually ever have cacheline contention, but // maybe should be optimized out with a cfg(test) anyway? - (*self.packet()).state.store(STATE_ONE, Release); + (*self.packet()).state.store(STATE_ONE, Relaxed); rtdebug!("rendezvous recv"); sched.metrics.rendezvous_recvs += 1; @@ -299,7 +299,7 @@ impl<T> SelectPort<T> for PortOne<T> { unsafe { // See corresponding store() above in block_on for rationale. // FIXME(#8130) This can happen only in test builds. - assert!((*packet).state.load(Acquire) == STATE_ONE); + assert!((*packet).state.load(Relaxed) == STATE_ONE); let payload = (*packet).payload.take(); |
