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§
- Atomic
Monotonic Instant - An atomic wrapper around
zx::MonotonicInstant. - Dynamic
Lock DepMutex - A Mutex that dynamically enforces lock ordering at runtime, without using types for levels.
- Dynamic
Lock DepRw Lock - An RwLock that dynamically enforces lock ordering at runtime, without using types for levels.
- Event
Wait Guard - A guard object to enforce that clients call
begin_waitbeforeblock_until. - Interruptible
Event - A blocking object that can either be notified normally or interrupted
- Lock
DepGuard - Lock
DepMutex - A Mutex that dynamically enforces lock ordering at runtime using types for levels.
- Lock
DepRead Guard - Lock
DepRw Lock - An RwLock that dynamically enforces lock ordering at runtime using types for levels.
- Lock
DepWrite Guard - Locked
- Enforcement mechanism for lock ordering.
- Mapped
Lock DepGuard - Mapped
Lock DepRead Guard - Mapped
Lock DepWrite Guard - Ordered
Mutex - A wrapper for mutex that requires a
Lockedcontext to acquire. This context must be of a level that precedesLin the lock ordering graph whereLis a level associated with this mutex. - Ordered
RwLock - A wrapper for an RwLock that requires a
Lockedcontext to acquire. This context must be of a level that precedesLin the lock ordering graph whereLis a level associated with this RwLock. - Port
Event - A wrapper around a
zx::Portthat optimizes for the case where events are signaled within a process.
Enums§
- Before
FsNode Append - Binder
Context Manager Level - Binder
Freeze Level - Binder
FsDevices Level - Binder
Object Level - Binder
Process Shared Memory Level - Binder
Process State Level - Binder
Procs Level - Device
Registry State - DirEntry
Children Level - DirEntry
Children Recursive Level - Ebpf
MapState Level - Ebpf
State Lock - Ebpf
Suspend Lock - Fastrpc
Inner State - File
Object Offset - File
OpsCore - FsNode
Append - FsRename
- FsRename
Recursive - Fuse
DirEntry Children Level - Fuse
FsRename Level - Kernel
IpTables - Kernel
Swap Files - Memory
Pressure Monitor - Memory
Pressure Monitor Client State - Memory
Xattr Storage Level - MmDumpable
- Notify
Kind - The kind of notification.
- Port
Wait Result - The result of a call to [
PortEvent.wait]. - Process
Group State - Remote
Binder Handle Level - Resource
Accessor Level - Task
Release - Terminal
Lock - Thread
Group Limits - Uninterruptible
Lock - Unlocked
- “Highest” lock level
- User
Fault Inner - Wake
Reason - A description of why a
block_untilreturned without the event being notified.
Traits§
- Async
Unlockable - 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.
- Lock
After - Marker trait that indicates that
Selfcan be locked afterA. - Lock
Before - Marker trait that indicates that
Selfis an ancestor ofX. - Lock
Equal OrBefore - Marker trait that indicates that
SelfisXor an ancestor ofX. - LockFor
- Describes how to apply a lock type to the implementing type.
- Lock
Level - A trait for types that represent a lock level in the lock dependency tracker.
- Mutex
Like - A generic mutex for the ordered_lock operations.
- RwLock
For - 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 afterL. - lock_
both - Lock two OrderedMutex of the same level in the consistent order. Returns both guards and a new locked context.
- ordered_
lock - Lock
m1andm2in a consistent order (using the memory address of m1 and m2 and returns the associated guard. This ensure thatordered_lock(m1, m2)andordered_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.