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.
Properties
IsReentrant
True if the current async flow is waiting for the lock.
public bool IsReentrant { get; }
Property Value
Methods
BorrowAsync()
Should be called as the header of a using block.
public ValueTask<Synchronised<T>.Guard> BorrowAsync()