1mod atomic_time;
8mod condvar;
9mod interruptible_event;
10mod lock_dep_mutex;
11mod lock_ordering;
12mod lock_traits;
13mod locks;
14mod object_waiter;
15mod port_event;
16mod rcu_lock;
17mod rw_seq_lock;
18mod thread_affinity;
19
20pub use atomic_time::*;
21pub use condvar::*;
22pub use interruptible_event::*;
23pub use lock_dep_mutex::*;
24pub use lock_ordering::*;
25pub use lock_ordering_macro::*;
26pub use lock_traits::*;
27pub use locks::*;
28pub use object_waiter::*;
29pub use port_event::*;
30pub use rcu_lock::*;
31pub use rw_seq_lock::*;
32pub use thread_affinity::*;
33
34extern crate self as starnix_sync;
37
38pub(crate) const STACK_CLEAN_DELAY: zx::MonotonicDuration = zx::MonotonicDuration::from_seconds(5);
41
42#[inline]
46pub(crate) fn initial_clean_deadline(
47 deadline: zx::MonotonicInstant,
48 clean_delay: zx::MonotonicDuration,
49) -> zx::MonotonicInstant {
50 if deadline > zx::MonotonicInstant::ZERO {
53 std::cmp::min(deadline, zx::MonotonicInstant::after(clean_delay))
54 } else {
55 deadline
56 }
57}