Skip to main content

Crate starnix_sync

Crate starnix_sync 

Source
Expand description

Synchronization objects used by Starnix

Re-exports§

pub use crate::LockBefore;
pub use crate::LockEqualOrBefore;
pub use crate::LockFor;
pub use crate::RwLockFor;

Macros§

lock_level
lock_ordering
This macro takes a definition of the lock ordering graph in the form of lock_ordering!{ Unlocked -> A, A -> B, Unlocked -> C, }

Structs§

AtomicMonotonicInstant
An atomic wrapper around zx::MonotonicInstant.
EventWaitGuard
A guard object to enforce that clients call begin_wait before block_until.
InterruptibleEvent
A blocking object that can either be notified normally or interrupted
LockDepGuard
LockDepMutex
A Mutex that dynamically enforces lock ordering at runtime.
LockDepReadGuard
LockDepRwLock
An RwLock that dynamically enforces lock ordering at runtime.
LockDepWriteGuard
Locked
Enforcement mechanism for lock ordering.
OrderedMutex
A wrapper for mutex that requires a Locked context to acquire. This context must be of a level that precedes L in the lock ordering graph where L is a level associated with this mutex.
OrderedRwLock
A wrapper for an RwLock that requires a Locked context to acquire. This context must be of a level that precedes L in the lock ordering graph where L is a level associated with this RwLock.
PortEvent
A wrapper around a zx::Port that optimizes for the case where events are signaled within a process.

Enums§

BeforeFsNodeAppend
DeviceRegistryState
EbpfMapStateLevel
EbpfStateLock
EbpfSuspendLock
FastrpcInnerState
FileOpsCore
FsNodeAppend
KernelIpTables
KernelSwapFiles
MemoryPressureMonitor
MemoryPressureMonitorClientState
MemoryXattrStorageLevel
MmDumpable
NotifyKind
The kind of notification.
PortWaitResult
The result of a call to [PortEvent.wait].
ProcessGroupState
ResourceAccessorLevel
TaskRelease
TerminalLock
ThreadGroupLimits
UninterruptibleLock
Unlocked
“Highest” lock level
UserFaultInner
WakeReason
A description of why a block_until returned without the event being notified.

Traits§

AsyncUnlockable
A trait for lock guards that can be temporarily unlocked asynchronously. This is useful for performing async operations while holding a lock, without causing deadlocks or holding the lock for an extended period.
LockAfter
Marker trait that indicates that Self can be locked after A.
LockBefore
Marker trait that indicates that Self is an ancestor of X.
LockEqualOrBefore
Marker trait that indicates that Self is X or an ancestor of X.
LockFor
Describes how to apply a lock type to the implementing type.
LockLevel
A trait for types that represent a lock level in the lock dependency tracker.
RwLockFor
Describes how to acquire reader and writer locks to the implementing type.

Functions§

allow_subclass
A token that allows the next lock acquisition of the same level as the currently maximal held lock to use an incremented subclass. Allows subclassing of the currently maximal held lock.
assert_lock_level
Asserts that the current thread can acquire locks at level L. Returns a token that, when held, forces subsequent locks to be after L.
lock_both
Lock two OrderedMutex of the same level in the consistent order. Returns both guards and a new locked context.
ordered_lock
Lock m1 and m2 in a consistent order (using the memory address of m1 and m2 and returns the associated guard. This ensure that ordered_lock(m1, m2) and ordered_lock(m2, m1) will not deadlock.
ordered_lock_vec
Acquires multiple mutexes in a consistent order based on their memory addresses. This helps prevent deadlocks.

Type Aliases§

MappedMutexGuard
Mutex
MutexGuard
RwLock
RwLockReadGuard
RwLockWriteGuard