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