ucommon
7.0.0
About: GNU uCommon C++ is a portable and optimized class framework for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, object serialization, thread-optimized string and data structure classes, etc..
![]() ![]() |
#include <atomic.h>
Public Member Functions | |
counter (atomic_t initial=0) | |
atomic_t | fetch_retain () volatile |
atomic_t | fetch_release () volatile |
atomic_t | fetch_add (atomic_t offset=1) volatile |
atomic_t | fetch_sub (atomic_t offset=1) volatile |
atomic_t | operator++ () volatile |
atomic_t | operator-- () volatile |
atomic_t | operator+= (atomic_t offset) volatile |
atomic_t | operator-= (atomic_t offset) volatile |
atomic_t | get () volatile |
void | clear () volatile |
operator atomic_t () volatile | |
atomic_t | operator* () volatile |
Private Member Functions | |
__DELETE_COPY (counter) | |
Private Attributes | |
volatile atomic_t | value |
Atomic counter class.
Can be used to manipulate value of an atomic counter without requiring explicit thread locking.
ucommon::Atomic::counter::counter | ( | atomic_t | initial = 0 | ) |
|
private |
void ucommon::Atomic::counter::clear | ( | ) | volatile |
Definition at line 363 of file atomic.cpp.
References ucommon::Mutex::protect(), and ucommon::Mutex::release().
Definition at line 370 of file atomic.cpp.
References ucommon::Mutex::protect(), and ucommon::Mutex::release().
atomic_t ucommon::Atomic::counter::fetch_release | ( | ) | volatile |
Definition at line 395 of file atomic.cpp.
atomic_t ucommon::Atomic::counter::fetch_retain | ( | ) | volatile |
Definition at line 390 of file atomic.cpp.
Definition at line 380 of file atomic.cpp.
References ucommon::Mutex::protect(), and ucommon::Mutex::release().
atomic_t ucommon::Atomic::counter::get | ( | ) | volatile |
Definition at line 354 of file atomic.cpp.
References ucommon::Mutex::protect(), and ucommon::Mutex::release().
Referenced by ucommon::TypeRef::Counted::copies(), and ucommon::TypeRef::Counted::is().
|
inline |
|
inline |
atomic_t ucommon::Atomic::counter::operator++ | ( | ) | volatile |
Definition at line 428 of file atomic.cpp.
Definition at line 438 of file atomic.cpp.
atomic_t ucommon::Atomic::counter::operator-- | ( | ) | volatile |
Definition at line 433 of file atomic.cpp.
Definition at line 443 of file atomic.cpp.
|
mutableprivate |