Skip to main content

moirai_sync/
lib.rs

1//! High-performance synchronization primitives for Moirai concurrency library.
2//!
3//! This module provides specialized synchronization primitives that add value
4//! beyond the standard library, following YAGNI and DRY principles.
5
6#![deny(missing_docs)]
7#![allow(clippy::new_without_default)]
8#![allow(clippy::manual_hash_one)]
9
10/// Synchronization primitives: sharded maps and pools, spin locks,
11/// futex-backed mutexes, and completion barriers.
12pub mod sync;
13
14// Re-export the canonical AtomicCounter from moirai-utils (SSOT)
15pub use moirai_utils::AtomicCounter;
16
17// Re-export standard library primitives directly (DRY principle)
18pub use std::sync::{
19    Barrier, Condvar, Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard,
20};
21
22// Re-export LockFreeStack from moirai-core to maintain DRY principle
23pub use moirai_core::pool::LockFreeStack;
24
25// Re-export sync submodule items directly at crate root
26pub use self::sync::{
27    ConcurrentHashMap, FutexMutex, FutexMutexGuard, SegmentPoisoned, ShardedResourcePool,
28    SizeBounded, SpinLock, SpinLockGuard, WaitGroup,
29};