Struct Epoch.RecycleBin
Encapsulates actions deferred previously by Defer(Action) method and its overloads, and the unmanaged resources to be released by NativeResourceManager.
Inherited Members
Namespace: DotNext.Threading
Assembly: DotNext.dll
Syntax
public readonly struct Epoch.RecycleBin
Remarks
The action can be called at any point in time. The call does not necessarily have to be protected by the epoch scope. The bin must be cleared only once: clearing the copies of the same bin invokes the actions and releases the unmanaged resources more than once.
Properties
View SourceIsEmpty
Gets a value indicating that the action is empty.
Declaration
public bool IsEmpty { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
View SourceClear(bool)
Invokes all deferred actions.
Declaration
public void Clear(bool throwOnFirstException = false)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | throwOnFirstException | true if exceptions should immediately propagate; otherwise, false. |
ClearAsync()
Invokes deferred actions as parallel task.
Declaration
public Task ClearAsync()
Returns
| Type | Description |
|---|---|
| Task | The task representing execution of deferred actions. |
QueueCleanup()
Queues invocation of deferred actions to the thread pool.
Declaration
public void QueueCleanup()