Simple Atomic abstraction around the long type to make atomic operations on long types simpler to manage in code. The default value of this type is zero.
More...
|
| | AtomicLong (long initialValue=0) |
| | Create a new instance with the given value or default to zero. More...
|
| |
| bool | CompareAndSet (long expect, long update) |
| | Atomically sets the value to the new one if the current value == expected. More...
|
| |
| long | IncrementAndGet () |
| | Atomically increments the current value. More...
|
| |
| long | DecrementAndGet () |
| | Atomically decrements the current value. More...
|
| |
| long | Get () |
| | Reads the value of the long atomically and returns it. More...
|
| |
| void | Set (long newValue) |
| | Performs an atomic write of the long value. More...
|
| |
|
|
static implicit | operator long (AtomicLong atomicLong) |
| |
|
| long | Value => Get() |
| | Read the value of the long atomically and return it. More...
|
| |
Simple Atomic abstraction around the long type to make atomic operations on long types simpler to manage in code. The default value of this type is zero.
◆ AtomicLong()
| Apache.Qpid.Proton.Client.Concurrent.AtomicLong.AtomicLong |
( |
long |
initialValue = 0 | ) |
|
|
inline |
Create a new instance with the given value or default to zero.
- Parameters
-
| initialValue | Initial value for the long |
◆ CompareAndSet()
| bool Apache.Qpid.Proton.Client.Concurrent.AtomicLong.CompareAndSet |
( |
long |
expect, |
|
|
long |
update |
|
) |
| |
|
inline |
Atomically sets the value to the new one if the current value == expected.
- Parameters
-
| expect | The value that is expected |
| update | The value to assign if the expectation is met. |
- Returns
◆ DecrementAndGet()
| long Apache.Qpid.Proton.Client.Concurrent.AtomicLong.DecrementAndGet |
( |
| ) |
|
|
inline |
Atomically decrements the current value.
- Returns
- The decremented value
◆ Get()
| long Apache.Qpid.Proton.Client.Concurrent.AtomicLong.Get |
( |
| ) |
|
|
inline |
Reads the value of the long atomically and returns it.
- Returns
- The value of the long
◆ IncrementAndGet()
| long Apache.Qpid.Proton.Client.Concurrent.AtomicLong.IncrementAndGet |
( |
| ) |
|
|
inline |
Atomically increments the current value.
- Returns
- The incremented value
◆ Set()
| void Apache.Qpid.Proton.Client.Concurrent.AtomicLong.Set |
( |
long |
newValue | ) |
|
|
inline |
Performs an atomic write of the long value.
- Parameters
-
| newValue | The new value to assign to the long |
◆ Value
| long Apache.Qpid.Proton.Client.Concurrent.AtomicLong.Value => Get() |
Read the value of the long atomically and return it.
The documentation for this class was generated from the following file:
- src/Proton.Client/Client/Concurrent/AtomicLong.cs