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. - CondVar
- A Condition Variable that is compatible with both standard Mutex and LockDepMutex in Starnix.
- 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. - RwSeq
Lock - A sequence lock that combines a standard lock (like a Mutex) with a sequence counter. This allows lock-free concurrent reads by spinning if a write is in progress, while still enforcing mutually exclusive writes.
- RwSeq
Lock Guard - A guard that manages the sequence counter and wraps the underlying lock guard.
- Thread
Affinity - A synchronization primitive that tracks thread affinity.
- Thread
Affinity Guard - Wait
Token - A token that proves the caller is allowed to access the inner guard. Its field is private, so it can only be constructed within this crate.
Enums§
- AioEvents
Lock - AioPending
Operations Lock - Audit
Deny Counts Lock - Audit
Netlink Client Audit Response Lock - Audit
Queue Lock - Audit
Sink Lock - 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 - Binder
Thread State Lock - Booted
Lock - Cgroup
Children Lock - Cgroup
PidTable Lock - Cgroup
State Lock - Cgroup
V1Level - Component
Controller Lock - Component
Mount Record Lock - DevKmsg
Lock - Device
Registry State - Device
Terminals Lock - DirEntry
Children Level - DirEntry
Children Recursive Level - Dynamic
File State Lock - Dynamic
Thread Spawner Lock - Ebpf
MapState Level - Ebpf
State Lock - Ebpf
Suspend Lock - Epoll
State Lock - Epoll
Waitable State Lock - Event
FdInner Lock - Event
Handler Ready Queue Lock - Executor
Vmar Manager Lock - Fastrpc
Inner State - FdTable
Writer Queue Lock - File
Async Owner Lock - File
Epoll Files Lock - File
Lease Lock - File
Object Offset - File
OpsCore - File
Server Stats Lock - File
System Entries Lock - File
System Permanent Lock - FsContext
State Lock - FsNode
Append - FsNode
Flock Info Lock - FsNode
FsVerity Lock - FsNode
Info Level - FsNode
Info Recursive Level - FsNode
Write Guard State Lock - FsRegistry
Lock - FsRename
- FsRename
Recursive - Fuchsia
Remote Target Lock - Fuse
DirEntry Children Level - Fuse
FsNode Info Level - Fuse
FsRename Level - Futex
Table State Lock - Generic
Netlink Server State Lock - HrTimer
IsInterval Lock - HrTimer
Manager State Lock - Icmp
Ping Gids Lock - Inflight
Vmspliced Payloads Lock - Inotify
State Lock - Inotify
Watchers Lock - Interval
Timer State - IoUring
State Lock - Kernel
IpTables - Kernel
Swap Files - MapInfo
Cache BufLock - Memory
Attribution Publisher Lock - Memory
Directory Readdir Position Lock - Memory
Pressure Monitor - Memory
Pressure Monitor Client State - Memory
Xattr Storage Level - MmDumpable
- Mounts
Level - Namespace
Flags Lock - Netlink
Socket Inner Lock - Netstack
Devices Lock - Notify
Kind - The kind of notification.
- Pager
Files ByInode Lock - Pager
Filesystems Lock - Perf
Event Level - Perf
Format IdLookup Table Lock - Perf
Ring Buffer State Lock - PidTo
Koid MapInner Lock - PidTo
Koid MapLock - Port
Wait Result - The result of a call to [
PortEvent.wait]. - Port
Waiter Callbacks Lock - Port
Waiter Wait Queues Lock - Power
Message Counters Lock - Process
Group State - Profile
Handle Cache Lock - PtsIds
SetLock - Qipcrtr
Socket Inner Lock - Record
Locks State Lock - Remote
Binder Controller Lock - Remote
Binder Handle Level - Remote
Block Device Registry Devices Lock - Remote
Bundle Inner Lock - Remote
Unix Domain Socket State Lock - Resource
Accessor Level - RwQueue
Inner Lock - SeLinux
Peer SidLock - SeLinux
Pending Entries Lock - SeLinux
Pending File Systems Lock - SeLinux
Update Lock - Seccomp
Notifier Lock - Session
Mutable State Lock - Signal
Actions Lock - Signal
FdMask Lock - Simple
Directory Entries Lock - Socket
State Lock - Stub
Bytes File State Lock - Suspend
Resume Manager Inner Lock - Syscall
LogFilters Lock - Syslog
State Lock - Syslog
Subscription Lock - Task
Command Level - Task
Creds Lock - Task
Mutable State Lock - Task
Release - Terminal
Mutable State Lock - Thread
Group Limits - Thread
Group Mutable State Lock - Thread
Group Pending Signals Lock - Thread
Group Ptracees Lock - Thread
Lockup Detector Registry Lock - Timer
File Info Lock - Timer
Table State Lock - Touch
Power Policy Enabled Lock - UEvent
Netlink Socket Device Listener KeyLock - Uninterruptible
Lock - Unix
Socket Inner Lock - Unlocked
- “Highest” lock level
- User
Fault Inner - UtsNamespace
Lock - Vmsplice
Segments Lock - Vsock
Socket Inner Lock - Wait
Queue Impl Lock - Waiter
Event Handler Lock - Wake
Reason - A description of why a
block_untilreturned without the event being notified. - Wake
Sources Lock - Wake
Watchers Lock
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.
- RwLock
Like - A generic rwlock for the ordered_lock operations.
- Waitable
Mutex Guard
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.
- ordered_
read_ lock - Lock
r1andr2in a consistent order (using the memory address of r1 and r2) for reading. - ordered_
read_ lock_ vec - Acquires multiple rwlocks in a consistent order based on their memory addresses for reading.
- ordered_
write_ lock - Lock
r1andr2in a consistent order (using the memory address of r1 and r2) for writing. - ordered_
write_ lock_ vec - Acquires multiple rwlocks in a consistent order based on their memory addresses for writing.