23 #if ! defined (octave_oct_refcount_h) 24 #define octave_oct_refcount_h 1 26 #include "octave-config.h" 28 #if (defined (OCTAVE_ENABLE_ATOMIC_REFCOUNT) \ 29 && (defined (__GNUC__) || defined (_MSC_VER))) 31 # if defined (__GNUC__) 33 # define OCTAVE_ATOMIC_INCREMENT(x) __sync_add_and_fetch (x, 1) 34 # define OCTAVE_ATOMIC_DECREMENT(x) __sync_add_and_fetch (x, -1) 35 # define OCTAVE_ATOMIC_POST_INCREMENT(x) __sync_fetch_and_add (x, 1) 36 # define OCTAVE_ATOMIC_POST_DECREMENT(x) __sync_fetch_and_add (x, -1) 38 # elif defined (_MSC_VER) 42 # define OCTAVE_ATOMIC_INCREMENT(x) \ 43 _InterlockedIncrement (static_cast<long *> (x)) 45 # define OCTAVE_ATOMIC_DECREMENT(x) \ 46 _InterlockedDecrement (static_cast<long *> (x)) 48 # define OCTAVE_ATOMIC_POST_INCREMENT(x) \ 49 _InterlockedExchangeAdd (static_cast<long *> (x)) 51 # define OCTAVE_ATOMIC_POST_DECREMENT(x) \ 52 _InterlockedExchangeAdd (static_cast<long *> (x)) 60 # define OCTAVE_ATOMIC_INCREMENT(x) ++(*(x)) 61 # define OCTAVE_ATOMIC_DECREMENT(x) --(*(x)) 62 # define OCTAVE_ATOMIC_POST_INCREMENT(x) (*(x))++ 63 # define OCTAVE_ATOMIC_POST_DECREMENT(x) (*(x))-- 80 :
count (initial_count)
125 template <
typename T>
#define OCTAVE_ATOMIC_DECREMENT(x)
count_type operator++(void)
#define OCTAVE_ATOMIC_INCREMENT(x)
refcount(count_type initial_count)
#define OCTAVE_ATOMIC_POST_INCREMENT(x)
#define OCTAVE_ATOMIC_POST_DECREMENT(x)
count_type value(void) const
count_type operator--(void)