diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2019-10-14 17:49:47 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2019-10-14 18:05:07 -0300 |
| commit | b9bc431bd22e8e53398281d1c800fd78fe91e613 (patch) | |
| tree | 7ac0b97020260c4f02de34803337ae51e1b2eb5a | |
| parent | 83560225adf05461e181f5dde303ae8a93a95aba (diff) | |
| download | rust-b9bc431bd22e8e53398281d1c800fd78fe91e613.tar.gz rust-b9bc431bd22e8e53398281d1c800fd78fe91e613.zip | |
Rename serial_join and serial_scope to join and scope
| -rw-r--r-- | src/librustc_data_structures/sync.rs | 47 |
1 files changed, 22 insertions, 25 deletions
diff --git a/src/librustc_data_structures/sync.rs b/src/librustc_data_structures/sync.rs index 1d81aa0b386..9622c290039 100644 --- a/src/librustc_data_structures/sync.rs +++ b/src/librustc_data_structures/sync.rs @@ -41,29 +41,6 @@ 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}; @@ -176,8 +153,28 @@ cfg_if! { pub type AtomicU32 = Atomic<u32>; pub type AtomicU64 = Atomic<u64>; - pub use self::serial_join as join; - pub use self::serial_scope as scope; + pub fn 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 scope<F, R>(f: F) -> R + where F: FnOnce(&SerialScope) -> R + { + f(&SerialScope) + } #[macro_export] macro_rules! parallel { |
