#include <atomic.h>
Collaboration diagram for AtomicInt:

Public Member Functions | |
| AtomicInt (int initial=0) | |
| Set initial value. | |
| ~AtomicInt () | |
| int | val () const |
| Get current value:. | |
| operator int () const | |
| void | set (int i) |
| Set a new value:. | |
| void | operator= (int i) |
| void | inc () |
| Increment atomic variable:. | |
| void | operator++ () |
| void | dec () |
| Decrement atomic variable:. | |
| void | operator-- () |
| bool | DecAndTest () |
| void | add (int i) |
| Atomically add intger to atomic variable:. | |
| void | operator+= (int i) |
| void | sub (int i) |
| Atomically subtract intger to atomic variable:. | |
| void | operator-= (int i) |
| bool | SubAndTest (int i) |
Private Attributes | |
| FastMutex | m |
| gint | v |
| No volatile needed. | |
Useful for resource counting etc...
Definition at line 63 of file atomic.h.
|
|
Set initial value.
Definition at line 79 of file atomic.h. References USE_PRIVATE__ATOMIC. |
|
|
|
|
|
Atomically add intger to atomic variable:.
Definition at line 135 of file atomic.h. References USE_PRIVATE__ATOMIC. |
|
|
Decrement atomic variable:.
Definition at line 116 of file atomic.h. References USE_PRIVATE__ATOMIC. |
|
|
Atomically decrements value by 1 and returns true if the result is 0, or false for all other cases. Definition at line 127 of file atomic.h. References USE_PRIVATE__ATOMIC. Referenced by TLString::_deref(), and TLString::_derefN(). |
|
|
Increment atomic variable:.
Definition at line 106 of file atomic.h. References USE_PRIVATE__ATOMIC. Referenced by TLString::_aqref(), and TLString::_aqrefN(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Set a new value:.
Definition at line 97 of file atomic.h. References USE_PRIVATE__ATOMIC. Referenced by MessageManager::_RecomputeMTMask(). |
|
|
Atomically subtract intger to atomic variable:.
Definition at line 145 of file atomic.h. References USE_PRIVATE__ATOMIC. |
|
|
Atomically subtracts i from v and returns true if the result is zero, or false for all other cases. Definition at line 155 of file atomic.h. References USE_PRIVATE__ATOMIC. |
|
|
Get current value:.
Definition at line 88 of file atomic.h. Referenced by TLString::_detachN(), TLString::SData::_DoTightenSize(), TLString::SData::_EnsureSize(), MessageManager::_IsRequestedType(), TLString::SData::DownSizeIfNeeded(), TLString::skip(), TLString::TightenSize(), TLString::trunc(), TLString::vsprintf(), and TLString::zero(). |
|
|
|
|
|
No volatile needed.
|
1.3.5