Namespace Singulink.Threading
Classes
AsyncReadWriteLock
A reader/writer lock for asynchronous code that can be held across an await.
InterlockedSpin
Provides various convenience lock-free atomic "spin" operations.
KeyLocker<T>
Provides a mechanism for locking resources based on a key.
LeafLock
A non-reentrant lock for short critical sections that never nest and are never held across other work.
ReadWriteLock
A reader/writer lock that manages access to a resource via disposable guards, allowing multiple threads for reading or exclusive access for writing.
Structs
AsyncReadGuard
Represents a hold on an AsyncReadWriteLock in read mode. Disposing the instance leaves the lock.
AsyncWriteGuard
Represents a hold on an AsyncReadWriteLock in write mode. Disposing the instance leaves the lock.
InterlockedFlag
Provides a lock-free atomic flag that can be set and cleared using interlocked operations.
KeyLock<T>
Represents an acquired lock for a specific key in a KeyLocker<T>. Disposing the instance releases the lock.
LeafLockGuard
Represents a hold on a LeafLock. Disposing the instance leaves the lock.
ReadGuard
Represents a disposable read guard over a ReadWriteLock.
RetryTimer
Provides the waits between attempts of an operation that is retried after a delay until a time limit passes, with time measured by a TimeProvider.
UpgradeableReadGuard
Represents a disposable upgradeable read guard over a ReadWriteLock. The guard has read access to the protected resource and can temporarily upgrade to scoped write access (see EnterUpgradedWriteGuard()) or permanently downgrade to a plain read lock (see DowngradeToReadLock()).
WriteGuard
Represents a disposable write guard over a ReadWriteLock.
Enums
AsyncReadWriteLockPreference
Specifies who enters an AsyncReadWriteLock first when readers and writers both want it.