Class ThreadContextAwaiter
Awaiter preserving the thread context.
Inheritance
System.Object
ThreadContextAwaiter
Implements
System.Runtime.CompilerServices.ICriticalNotifyCompletion
System.Runtime.CompilerServices.INotifyCompletion
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Threading.Tasks
Assembly: Kephas.Core.dll
Syntax
public class ThreadContextAwaiter : ICriticalNotifyCompletion, INotifyCompletion
Constructors
| Improve this Doc View SourceThreadContextAwaiter(Task)
Initializes a new instance of the ThreadContextAwaiter class.
Declaration
public ThreadContextAwaiter(Task task)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.Tasks.Task | task | The task. |
Properties
| Improve this Doc View SourceIsCompleted
Gets a value indicating whether the awaiter is completed.
Declaration
public bool IsCompleted { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Methods
| Improve this Doc View SourceGetAwaiter()
Gets this awaiter.
Declaration
public ThreadContextAwaiter GetAwaiter()
Returns
Type | Description |
---|---|
ThreadContextAwaiter | The awaiter. |
GetResult()
Notifies the awaiter to get the result.
Declaration
public void GetResult()
OnCompleted(Action)
Schedules the continuation action that's invoked when the instance completes.
Declaration
public void OnCompleted(Action continuation)
Parameters
Type | Name | Description |
---|---|---|
System.Action | continuation | The action to invoke when the operation completes. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
UnsafeOnCompleted(Action)
Schedules the continuation action that's invoked when the instance completes.
Declaration
public void UnsafeOnCompleted(Action continuation)
Parameters
Type | Name | Description |
---|---|---|
System.Action | continuation | The action to invoke when the operation completes. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
Implements
System.Runtime.CompilerServices.ICriticalNotifyCompletion
System.Runtime.CompilerServices.INotifyCompletion