Struct InterlockedFlag
Provides a lock-free atomic flag that can be set and cleared using interlocked operations.
Namespace: Singulink.Threading
Assembly: Singulink.Threading.dll
Syntax
public struct InterlockedFlag
Constructors
Name | Description |
---|---|
InterlockedFlag(bool) | Initializes a new instance of the InterlockedFlag struct with the specified initial state. |
Properties
Name | Description |
---|---|
IsSet | Gets a value indicating whether the flag has been set by performing a volatile read to get the most up to date value. |
Methods
Name | Description |
---|---|
TryClear() | Tries to clear the flag and returns true if the operation was successful, or false if the flag was already cleared. |
TrySet() | Tries to set the flag and returns true if the operation was successful, or false if the flag was already set. |