Class AtomicFlag
Provides a thread-safe flag that can be set atomically. This class is optimized for performance in multi-threaded environments.
Implements
Inherited Members
Namespace: PoeShared.Scaffolding
Assembly: PoeShared.dll
Syntax
public sealed record AtomicFlag : IEquatable<AtomicFlag>
Constructors
| Name | Description |
|---|---|
| AtomicFlag() | Initializes a new instance of the AtomicFlag class. The flag is initially not set. |
Properties
| Name | Description |
|---|---|
| IsSet | Gets a value indicating whether the flag is set. This property is thread-safe. Performance Note: Uses Read(ref bool) for a low-overhead atomic read operation. Marked for aggressive inlining to reduce method call overhead. |
Methods
| Name | Description |
|---|---|
| Equals(AtomicFlag?) | |
| Equals(object?) | |
| GetHashCode() | |
| Set() | Sets the flag to true if it is not already set. This method is thread-safe. Performance Note: Uses Exchange(ref double, double) to ensure atomicity of the set operation. Marked for aggressive inlining to reduce method call overhead. Returns: True if the flag was set by this call; false if the flag was already set. |
| ToString() | |
| <Clone>$() |
Operators
| Name | Description |
|---|---|
| operator ==(AtomicFlag?, AtomicFlag?) | |
| operator !=(AtomicFlag?, AtomicFlag?) |