Class Synchronised<T>
Emulates a guarded asynchronous mutex.
public sealed class Synchronised<T>
Type Parameters
T
- Inheritance
-
Synchronised<T>
- Inherited Members
Remarks
Safe to use asynchronously. If sync-over-async is used, deadlocks are possible; check IsReentrant to avoid them.
Constructors
Synchronised(T)
Emulates a guarded asynchronous mutex.
public Synchronised(T value)
Parameters
valueT
Remarks
Safe to use asynchronously. If sync-over-async is used, deadlocks are possible; check IsReentrant to avoid them.
Fields
IsReentrant
True if a thread is waiting for the lock.
public readonly ThreadLocal<bool> IsReentrant
Field Value
Methods
BorrowAsync()
Should be called as the header of a using block.
public ValueTask<Synchronised<T>.Guard> BorrowAsync()