Skip to main content

Crate starnix_sync

Crate starnix_sync 

Source
Expand description

Synchronization objects used by Starnix

Macros§

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.
CondVar
A Condition Variable that is compatible with both standard Mutex and LockDepMutex in Starnix.
DynamicLockDepMutex
A Mutex that dynamically enforces lock ordering at runtime, without using types for levels.
DynamicLockDepRwLock
An RwLock that dynamically enforces lock ordering at runtime, without using types for levels.
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 using types for levels.
LockDepReadGuard
LockDepRwLock
An RwLock that dynamically enforces lock ordering at runtime using types for levels.
LockDepWriteGuard
LockLevelToken
A token that represents a lock level being held for lockdep purposes. This does not actually hold a lock, but updates the lockdep state as if it did.
MappedLockDepGuard
MappedLockDepReadGuard
MappedLockDepWriteGuard
PortEvent
A wrapper around a zx::Port that optimizes for the case where events are signaled within a process.
RwSeqLock
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.
RwSeqLockGuard
A guard that manages the sequence counter and wraps the underlying lock guard.
ThreadAffinity
A synchronization primitive that tracks thread affinity.
ThreadAffinityGuard
WaitToken
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§

AioEventsLock
AioPendingOperationsLock
AshmemStateLock
AuditDenyCountsLock
AuditNetlinkClientAuditResponseLock
AuditQueueLock
AuditSinkLock
BeforeFsNodeAppend
BinderContextManagerLevel
BinderFreezeLevel
BinderFsDevicesLevel
BinderObjectLevel
BinderProcessSharedMemoryLevel
BinderProcessStateLevel
BinderProcsLevel
BinderThreadStateLock
BootedLock
CgroupChildrenLock
CgroupDirectoryInterfaceFilesLock
CgroupDirectoryNodesLock
CgroupPidTableLock
CgroupStateLock
CgroupV1Level
ComponentControllerLock
ComponentMountRecordLock
DevKmsgLock
DeviceMapperRegistryDevicesLock
DeviceRegistryStateLevel
DeviceTerminalsLock
DirEntryChildrenLevel
DirEntryChildrenRecursiveLevel
DmDeviceStateLock
DynamicFileStateLock
DynamicThreadSpawnerLock
EbpfMapStateLevel
EbpfStateLock
EbpfSuspendLock
EpollStateLock
EpollWaitableStateLock
EventFdInnerLock
EventHandlerReadyQueueLock
ExecutorVmarManagerLock
FastrpcInnerState
FdTableWriterQueueLock
FileAsyncOwnerLock
FileEpollFilesLock
FileLeaseLock
FileObjectOffset
FileServerStatsLock
FileSystemEntriesLock
FileSystemPermanentLock
FramebufferInfoLock
FramebufferMemoryLock
FramebufferPresentationReceiverLock
FramebufferSceneStateLock
FramebufferViewBoundProtocolsLock
FramebufferViewIdentityLock
FsContextStateLock
FsNodeAppend
FsNodeFlockInfoLock
FsNodeFsVerityLock
FsNodeInfoLevel
FsNodeInfoRecursiveLevel
FsNodeWriteGuardStateLock
FsRegistryLock
FsRename
FsRenameRecursive
FuchsiaRemoteTargetLock
FunctionFsResultLock
FunctionFsStateLock
FuseConnectionStateLock
FuseConnectionsLock
FuseDirEntryChildrenLevel
FuseFsNodeInfoLevel
FuseFsRenameLevel
FuseNodeStateLock
FutexTableStateLock
GenericNetlinkServerStateLock
HrTimerIsIntervalLock
HrTimerManagerStateLock
IcmpPingGidsLock
InflightVmsplicedPayloadsLock
InotifyStateLock
InotifyWatchersLock
InputDeviceFileNodesLock
InputEventRelayOpenedFilesLock
InputFileInputFileLock
IntervalTimerState
IoUringStateLock
KernelIpTables
KernelSwapFiles
KgslAllocatorLock
KgslContextsLock
KgslGpuObjsLock
KgslSyncSourcesLock
LoopDeviceStateLock
LoopDevicesLock
MagmaBuffersLock
MagmaConnectionsLock
MagmaDevicesLock
MagmaSemaphoresLock
MapInfoCacheBufLock
MemoryAttributionPublisherLock
MemoryDirectoryReaddirPositionLock
MemoryPressureMonitor
MemoryPressureMonitorClientState
MemoryXattrStorageLevel
MmDumpable
MountsLevel
NamespaceFlagsLock
NanohubContentsLock
NanohubServiceLock
NetlinkSocketInnerLock
NetnsIdLock
NetstackDevicesLock
NmfsNetworkManagerLock
NotifyKind
The kind of notification.
OverlayFsDirEntriesLock
OverlayFsStateLock
PagerFilesByInodeLock
PagerFilesystemsLock
PerfEventLevel
PerfFormatIdLookupTableLock
PerfRingBufferStateLock
PidToKoidMapInnerLock
PidToKoidMapLock
PortWaitResult
The result of a call to [PortEvent.wait].
PortWaiterCallbacksLock
PortWaiterWaitQueuesLock
PowerMessageCountersLock
ProcessGroupState
ProfileHandleCacheLock
PtsIdsSetLock
QbgReadQueueLock
QbgShutdownLock
QipcrtrSocketInnerLock
ReadWriteBytesFileLock
RecordLocksStateLock
RemoteBinderControllerLock
RemoteBinderHandleLevel
RemoteBinderResponderLock
RemoteBlockDeviceRegistryDevicesLock
RemoteBundleInnerLock
RemoteUnixDomainSocketStateLock
RwQueueInnerLock
SeLinuxFsContextSidLock
SeLinuxPeerSidLock
SeLinuxPendingEntriesLock
SeLinuxPendingFileSystemsLock
SeLinuxUpdateLock
SeccompNotifierLock
SessionMutableStateLock
SignalActionsLock
SignalFdMaskLock
SimpleDirectoryEntriesLock
SocketStateLock
StubBytesFileStateLock
SuspendResumeManagerInnerLock
SyscallLogFiltersLock
SyslogStateLock
SyslogSubscriptionLock
TaskCommandLevel
TaskCredsLock
TaskMutableStateLock
TerminalMutableStateLock
ThermalChargeLevelLock
ThreadGroupLimits
ThreadGroupMutableStateLock
ThreadGroupPendingSignalsLock
ThreadGroupPtraceesLock
ThreadLockupDetectorRegistryLock
TimerFileInfoLock
TimerTableStateLock
TouchPowerPolicyEnabledLock
TraceFsDataLock
TunDevTunLock
UEventNetlinkSocketDeviceListenerKeyLock
UinputDeviceStateLock
UninterruptibleLock
UnixSocketInnerLock
Unlocked
UserFaultInner
UtsNamespaceLock
VmspliceSegmentsLock
VsockSocketInnerLock
WaitQueueImplLock
WaiterEventHandlerLock
WakeReason
A description of why a block_until returned without the event being notified.
WakeSourcesLock
WakeWatchersLock

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.
LockLevel
A trait for types that represent a lock level in the lock dependency tracker.
MutexLike
A generic mutex for the ordered_lock operations.
RwLockLike
A generic rwlock for the ordered_lock operations.
WaitableMutexGuard

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.
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.
ordered_read_lock
Lock r1 and r2 in 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 r1 and r2 in 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.

Type Aliases§

MappedMutexGuard
Mutex
MutexGuard
RwLock
RwLockReadGuard
RwLockWriteGuard