15 #ifndef ATOMICADJUSTPOSIXIMPL_H
16 #define ATOMICADJUSTPOSIXIMPL_H
18 #include "dtoolbase.h"
19 #include "selectThreadImpl.h"
21 #ifdef HAVE_POSIX_THREADS
23 #include "numeric_types.h"
31 class EXPCL_DTOOL AtomicAdjustPosixImpl {
36 typedef void *Pointer;
38 INLINE
static void inc(TVOLATILE Integer &var);
39 INLINE
static bool dec(TVOLATILE Integer &var);
40 INLINE
static void add(TVOLATILE Integer &var, Integer delta);
41 INLINE
static Integer set(TVOLATILE Integer &var, Integer new_value);
42 INLINE
static Integer
get(
const TVOLATILE Integer &var);
44 INLINE
static Pointer set_ptr(TVOLATILE Pointer &var, Pointer new_value);
45 INLINE
static Pointer get_ptr(
const TVOLATILE Pointer &var);
47 INLINE
static Integer compare_and_exchange(TVOLATILE Integer &mem,
51 INLINE
static Pointer compare_and_exchange_ptr(TVOLATILE Pointer &mem,
56 static pthread_mutex_t _mutex;
59 #include "atomicAdjustPosixImpl.I"
61 #endif // HAVE_POSIX_THREADS