Struct Epoch.Scope
Represents a scope of the region of code protected by the epoch.
Inherited Members
Namespace: DotNext.Threading
Assembly: DotNext.dll
Syntax
public readonly ref struct Epoch.Scope
Methods
| Edit this page View SourceDefer(Action)
Registers user action to be called at some point in future when the resource protected by the epoch is no longer available to any consumer.
Declaration
public void Defer(Action callback)
Parameters
Type | Name | Description |
---|---|---|
Action | callback | The callback to enqueue. |
Remarks
Invocation order of callbacks is not guaranteed.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
Defer<TWorkItem>(TWorkItem)
Registers user action to be called at some point in future when the resource protected by the epoch is no longer available to any consumer.
Declaration
public void Defer<TWorkItem>(TWorkItem workItem) where TWorkItem : struct, IThreadPoolWorkItem
Parameters
Type | Name | Description |
---|---|---|
TWorkItem | workItem | The callback to enqueue. |
Type Parameters
Name | Description |
---|---|
TWorkItem | The type of the callback. |
Defer<T>(T, Action<T>)
Registers user action to be called at some point in future when the resource protected by the epoch is no longer available to any consumer.
Declaration
public void Defer<T>(T arg, Action<T> callback)
Parameters
Type | Name | Description |
---|---|---|
T | arg | The argument to be passed to the callback. |
Action<T> | callback | The callback to enqueue. |
Type Parameters
Name | Description |
---|---|
T |
Remarks
Invocation order of callbacks is not guaranteed.
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
RegisterForDiscard(Discardable)
Registers an object to be disposed at some point in future when the resource protected by the epoch is no longer available to any consumer.
Declaration
public void RegisterForDiscard(Epoch.Discardable discardable)
Parameters
Type | Name | Description |
---|---|---|
Epoch.Discardable | discardable | An object to be disposed. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
RegisterForDispose(IDisposable)
Registers an object to be disposed at some point in future when the resource protected by the epoch is no longer available to any consumer.
Declaration
public void RegisterForDispose(IDisposable disposable)
Parameters
Type | Name | Description |
---|---|---|
IDisposable | disposable | An object to be disposed. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|