Back to index

glibc  2.9
Defines
atomic.h File Reference

Go to the source code of this file.

Defines

#define atomic_compare_and_exchange_val_acq(mem, newval, oldval)
#define atomic_compare_and_exchange_bool_acq(mem, newval, oldval)

Define Documentation

#define atomic_compare_and_exchange_bool_acq (   mem,
  newval,
  oldval 
)
Value:
({ __typeof (mem) __gmemp = (mem);                            \
     __typeof (*mem) __gnewval = (newval);                           \
                                                              \
     *__gmemp == (oldval) ? (*__gmemp = __gnewval, 0) : 1; })

Definition at line 37 of file atomic.h.

#define atomic_compare_and_exchange_val_acq (   mem,
  newval,
  oldval 
)
Value:
({ __typeof (mem) __gmemp = (mem);                            \
     __typeof (*mem) __gret = *__gmemp;                              \
     __typeof (*mem) __gnewval = (newval);                           \
                                                              \
     if (__gret == (oldval))                                         \
       *__gmemp = __gnewval;                                         \
     __gret; })

Definition at line 28 of file atomic.h.