Table of Contents

Class Synchronised<T>

Namespace
The.Utility
Assembly
Instagile.dll

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

value T

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

ThreadLocal<bool>

Methods

BorrowAsync()

Should be called as the header of a using block.

public ValueTask<Synchronised<T>.Guard> BorrowAsync()

Returns

ValueTask<Synchronised<T>.Guard>