Class StopToken
Represents a token that can be used to request cancellation of operations.
public class StopToken : IDisposable
- Inheritance
-
StopToken
- Implements
- Inherited Members
- Extension Methods
Constructors
StopToken(nint, bool)
Initializes a new instance of the StopToken class.
public StopToken(nint stopTokenPtr, bool isDisposable)
Parameters
stopTokenPtr
nintPointer to the native stop token
isDisposable
boolSpecifies whether this token should be disposed by managed code:
- Set to false if the pointer is created by C++ (disposal handled by native code)
- Set to true if the pointer is created by StopSource.GetStopToken() (disposal handled by managed code)
Properties
StopTokenPtr
Gets the pointer to the native stop token.
public nint StopTokenPtr { get; }
Property Value
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
~StopToken()
Finalizer for the StopToken class.
protected ~StopToken()
IsStopPossible()
Checks if stopping is possible for this token.
public bool IsStopPossible()
Returns
- bool
True if stopping is possible; otherwise, false.
IsStopRequested()
Checks if stopping has been requested for this token.
public bool IsStopRequested()
Returns
- bool
True if stopping has been requested; otherwise, false.