1QB_ATOMIC_POINTER_COMPARE_ANlDi_bEqXbCHPArNoGgErQ(aB3m_)mAeTrO'MsICM_aPnOuIaNlTER_COMPARE_AND_EXCHANGE(3)
2
3
4
6 qb_atomic_pointer_compare_and_exchange - Compares oldval with the
7 pointer pointed to by atomic and if they are equal, atomically ex‐
8 changes *atomic with newval.
9
10
12 #include <qb/qbatomic.h>
13
14 int32_t qb_atomic_pointer_compare_and_exchange(
15 volatile void *QB_GNUC_MAY_ALIAS *atomic, /* a pointer to a void* */
16 void *oldval, /* the assumed old value of *atomic */
17 void *newval /* the new value of *atomic*/
18 );
19
21 atomic a pointer to a void*
22
23 oldval the assumed old value of *atomic
24
25 newval the new value of *atomic
26
28 Also acts as a memory barrier.
29
31 QB_TRUE if atomic was equal oldval, else QB_FALSE.
32
34 qb_atomic_int_set(3), qb_atomic_int_compare_and_exchange(3),
35 qb_atomic_int_get(3), qb_atomic_int_add(3), qb_atomic_init(3),
36 qb_atomic_pointer_get(3), qb_atomic_int_exchange_and_add(3),
37 qb_atomic_pointer_set(3)
38
40 Copyright (C) 2003 Sebastian Wilhelmi
41
42
43
44LIBQB 2021Q-B1_1A-T1O2MIC_POINTER_COMPARE_AND_EXCHANGE(3)