diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2019-10-14 15:15:02 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2019-10-14 18:05:07 -0300 |
| commit | 83560225adf05461e181f5dde303ae8a93a95aba (patch) | |
| tree | 8e51336c3b287c2c62a0847f37d21d254d67e528 | |
| parent | 068a8d163cdbab740c62bb7cc802c62e2c4b90b2 (diff) | |
| download | rust-83560225adf05461e181f5dde303ae8a93a95aba.tar.gz rust-83560225adf05461e181f5dde303ae8a93a95aba.zip | |
Move serial_scope and serial_join to parallel_compiler = false
| -rw-r--r-- | src/librustc_data_structures/sync.rs | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/librustc_data_structures/sync.rs b/src/librustc_data_structures/sync.rs index 432fa3c527f..1d81aa0b386 100644 --- a/src/librustc_data_structures/sync.rs +++ b/src/librustc_data_structures/sync.rs @@ -23,29 +23,6 @@ use std::marker::PhantomData; use std::ops::{Deref, DerefMut}; use crate::owning_ref::{Erased, OwningRef}; -pub fn serial_join<A, B, RA, RB>(oper_a: A, oper_b: B) -> (RA, RB) - where A: FnOnce() -> RA, - B: FnOnce() -> RB -{ - (oper_a(), oper_b()) -} - -pub struct SerialScope; - -impl SerialScope { - pub fn spawn<F>(&self, f: F) - where F: FnOnce(&SerialScope) - { - f(self) - } -} - -pub fn serial_scope<F, R>(f: F) -> R - where F: FnOnce(&SerialScope) -> R -{ - f(&SerialScope) -} - pub use std::sync::atomic::Ordering::SeqCst; pub use std::sync::atomic::Ordering; @@ -64,6 +41,29 @@ cfg_if! { } } + pub fn serial_join<A, B, RA, RB>(oper_a: A, oper_b: B) -> (RA, RB) + where A: FnOnce() -> RA, + B: FnOnce() -> RB + { + (oper_a(), oper_b()) + } + + pub struct SerialScope; + + impl SerialScope { + pub fn spawn<F>(&self, f: F) + where F: FnOnce(&SerialScope) + { + f(self) + } + } + + pub fn serial_scope<F, R>(f: F) -> R + where F: FnOnce(&SerialScope) -> R + { + f(&SerialScope) + } + use std::ops::Add; use std::panic::{resume_unwind, catch_unwind, AssertUnwindSafe}; |
