|
Nebula
|
#include <interlocked.h>
Atomic value only used to decrement, increment and read a 32 bit value.
Public Member Functions | |
| AtomicCounter () | |
| AtomicCounter (int initial) | |
| Constructor. | |
| bool | operator== (int value) const |
| Equals. | |
| bool | operator!= (int value) const |
| Not-equals. | |
| bool | operator> (int value) const |
| Greater. | |
| bool | operator>= (int value) const |
| Greater or equal. | |
| bool | operator< (int value) const |
| Less. | |
| bool | operator<= (int value) const |
| Less or equal. | |
| int | Increment () |
| Increment and return the new value. | |
| int | Decrement () |
| Decrement and return the new value. | |
| int | Add (int addend) |
| Add and return the old value. | |
| int | Subtract (int subtractor) |
| Subtract and return the old value. | |
| int | Exchange (int value) |
| Exchange and return the old value. | |
| void | RaceDecrement () |
| Unsafe decrement, only use before or after contention is possible. | |
| void | RaceIncrement () |
| Unsafe increment, only use before or after contention is possible. | |
| void | RaceExchange (int value) |
| Unsafe exchange, only use before or after contention is possible. | |
Public Attributes | |
| volatile int | counter |
|
inline |
|
inline |
Constructor.
|
inline |
Add and return the old value.
|
inline |
Decrement and return the new value.
|
inline |
Exchange and return the old value.
|
inline |
Increment and return the new value.
|
inline |
Not-equals.
|
inline |
Less.
|
inline |
Less or equal.
|
inline |
Equals.
|
inline |
Greater.
|
inline |
Greater or equal.
|
inline |
Unsafe decrement, only use before or after contention is possible.
|
inline |
Unsafe exchange, only use before or after contention is possible.
|
inline |
Unsafe increment, only use before or after contention is possible.
|
inline |
Subtract and return the old value.
| volatile int Threading::Interlocked::AtomicCounter::counter |