Struct ComAsyncResult
Represents the result of a COM asynchronous operation.
public struct ComAsyncResult : IDisposable
- Implements
- Inherited Members
- Extension Methods
Constructors
ComAsyncResult()
Represents the result of a COM asynchronous operation.
public ComAsyncResult()
Fields
Handle
The handle to the SafeWaitHandle.
public nint Handle
Field Value
Properties
ExceptionMemory
The span handle in which stores the information of the exceptions on ComAsyncException struct.
public PluginDisposableMemory<ComAsyncException> ExceptionMemory { readonly get; set; }
Property Value
IsCancelled
Whether the task is cancelled or not.
public bool IsCancelled { readonly get; set; }
Property Value
IsFaulty
Whether the task is faulted or not.
public bool IsFaulty { readonly get; set; }
Property Value
IsSuccessful
Whether the task is successfully executed or not.
public bool IsSuccessful { readonly get; set; }
Property Value
Methods
Alloc(Lock, Task)
Create/Alloc an instance of ComAsyncResult struct.
public static nint Alloc(Lock threadLock, Task task)
Parameters
threadLockLockThread lock to be used to create the ComAsyncResult struct.
taskTaskThe Task instance in which the result being passed to ComAsyncResult
Returns
- nint
A handle of the ComAsyncResult struct.
Alloc<T>(Lock, Task<T>)
Create/Alloc an instance of ComAsyncResult struct.
public static nint Alloc<T>(Lock threadLock, Task<T> task) where T : unmanaged
Parameters
threadLockLockThread lock to be used to create the ComAsyncResult struct.
taskTask<T>The Task instance in which the result being passed to ComAsyncResult
Returns
- nint
A handle of the ComAsyncResult struct.
Type Parameters
T
Dispose()
Dispose this instance of the current ComAsyncResult struct.
public void Dispose()
FreeResult(nint)
Dispose/Free the ComAsyncResult struct from its pointer.
public static void FreeResult(nint resultP)
Parameters
resultPnintA pointer of the ComAsyncResult struct.
GetWaitHandle(nint)
Gets the SafeWaitHandle handle from ComAsyncResult's handle.
public static nint GetWaitHandle(nint handle)
Parameters
handlenintA handle of the ComAsyncResult struct.
Returns
- nint
A SafeWaitHandle handle.
SetResult(Lock, Task)
Set the result of the task. This method is also used to write the information about the Task execution status/result to then being passed to managed code which loads the plugin.
public void SetResult(Lock threadLock, Task task)
Parameters
threadLockLockThread lock to be used to set the result.
taskTaskThe Task in which the status/result is being written from.
SetResult<T>(Lock, Task<T>)
Set the result of the task. This method is also used to write the information about the Task execution status/result to then being passed to managed code which loads the plugin.
public void SetResult<T>(Lock threadLock, Task<T> task) where T : unmanaged
Parameters
threadLockLockThread lock to be used to set the result.
taskTask<T>The Task in which the status/result is being written from.
Type Parameters
T