Skip to main content

radiate_core/domain/sync/
mod.rs

1mod cell;
2mod channel;
3mod group;
4mod thread_pool;
5
6use std::sync::Arc;
7
8pub use cell::MutCell;
9pub use channel::CommandChannel;
10pub use group::{WaitGroup, WaitGuard};
11pub use thread_pool::{WorkResult, get_thread_pool};
12
13pub trait ArcExt<T> {
14    fn pair(value: T) -> (Arc<T>, Arc<T>) {
15        let arc = Arc::new(value);
16        (Arc::clone(&arc), arc)
17    }
18
19    fn into_pair(self) -> (Arc<T>, Arc<T>);
20}
21
22impl<T> ArcExt<T> for Arc<T> {
23    fn into_pair(self) -> (Arc<T>, Arc<T>) {
24        (Arc::clone(&self), self)
25    }
26}