Struct UnsafeAtomicCounter32
A 32-bit atomic counter.
Namespace: Unity.Collections.LowLevel .Unsafe
Assembly: solution.dll
Syntax
public struct UnsafeAtomicCounter32
Remarks
Rather than have its own int, a counter points to an int. This arrangement lets counters in different jobs share reference to the same underlying int.
Constructors
Name | Description |
---|---|
Unsafe |
Initializes and returns an instance of UnsafeAtomicCounter32. |
Fields
Name | Description |
---|---|
Counter | The int that is modified by this counter. |
Methods
Name | Description |
---|---|
Add(int) | Atomically adds a value to this counter. |
Add |
Atomically adds a value to this counter. The result will not be greater than a maximum value. |
Reset(int) | Non-atomically sets this counter to a value. |
Sub(int) | Atomically subtracts a value from this counter. |
Sub |
Atomically subtracts a value from this counter. The result will not be less than a minimum value. |