|
Zen API
|
Collection of functions for atomic variable operations.
Public Member Functions | |
| kBool | kAtomic_CompareExchange32s (volatile k32s *atomic, k32s oldValue, k32s value) |
| Conditionally exchanges the value of an atomic variable. More... | |
| kBool | kAtomic_CompareExchangePointer (volatile kPointer *atomic, kPointer oldValue, kPointer value) |
| Conditionally exchanges the value of an atomic variable. More... | |
| k32s | kAtomic_Decrement32s (volatile k32s *atomic) |
| Decrements an atomic variable. More... | |
| k32s | kAtomic_Exchange32s (volatile k32s *atomic, k32s value) |
| Exchanges the value of an atomic variable. More... | |
| kPointer | kAtomic_ExchangePointer (volatile kPointer *atomic, kPointer value) |
| Exchanges the value of an atomic variable. More... | |
| k32s | kAtomic_Get32s (volatile k32s *atomic) |
| Gets the current value of an atomic variable. More... | |
| k32s | kAtomic_Increment32s (volatile k32s *atomic) |
| Increments an atomic variable. More... | |
Conditionally exchanges the value of an atomic variable.
If the atomic value is equal to the oldValue argument, then it is replaced by the value argument.
This method is thread-safe. Implements a full memory barrier.
| atomic | Pointer to atomic variable. |
| oldValue | Previous atomic value. |
| value | New atomic value. |
| kBool kAtomic_CompareExchangePointer | ( | volatile kPointer * | atomic, |
| kPointer | oldValue, | ||
| kPointer | value | ||
| ) |
Conditionally exchanges the value of an atomic variable.
If the atomic value is equal to the oldValue argument, then it is replaced by the value argument.
This method is thread-safe. Implements a full memory barrier.
| atomic | Pointer to atomic variable. |
| oldValue | Previous atomic value. |
| value | New atomic value. |
Decrements an atomic variable.
This method is thread-safe. Implements a full memory barrier.
| atomic | Pointer to atomic variable. |
Exchanges the value of an atomic variable.
This method is thread-safe. Implements a full memory barrier.
| atomic | Pointer to atomic variable. |
| value | New atomic value. |
Exchanges the value of an atomic variable.
This method is thread-safe. Implements a full memory barrier.
| atomic | Pointer to atomic variable. |
| value | New atomic value. |
Gets the current value of an atomic variable.
This method is thread-safe. Implements a full memory barrier.
| atomic | Pointer to atomic variable. |
Increments an atomic variable.
This method is thread-safe. Implements a full memory barrier.
| atomic | Pointer to atomic variable. |