1QB_ATOMIC_POINTER_COMPARE_ANlDi_bEqXbCHPArNoGgErQ(aB3m_)mAeTrO'MsICM_aPnOuIaNlTER_COMPARE_AND_EXCHANGE(3)
2
3
4

NAME

6       qb_atomic_pointer_compare_and_exchange   -  Compares  oldval  with  the
7       pointer pointed  to  by  atomic  and  if  they  are  equal,  atomically
8       exchanges *atomic with newval.
9

SYNOPSIS

11       #include <qb/qbatomic.h>
12
13       int32_t qb_atomic_pointer_compare_and_exchange(
14           volatile void *QB_GNUC_MAY_ALIAS   *atomic,
15           void                               *oldval,
16           void                               *newval
17       );
18

PARAMS

20       atomic a pointer to a void*
21
22       oldval the assumed old value of *atomic
23
24       newval the new value of *atomic
25

DESCRIPTION

27       Also acts as a memory barrier.
28

RETURN VALUE

30       QB_TRUE if atomic was equal oldval, else QB_FALSE.
31

SEE ALSO

33       qb_atomic_int_set(3), qb_atomic_int_compare_and_exchange(3),
34       qb_atomic_int_get(3), qb_atomic_int_add(3), qb_atomic_init(3),
35       qb_atomic_pointer_get(3), qb_atomic_int_exchange_and_add(3),
36       qb_atomic_pointer_set(3)
37
39       Copyright (C) 2010-2020 Red Hat, Inc. All rights reserved.
40
41
42
43LIBQB                             2020Q-B0_7A-T3O0MIC_POINTER_COMPARE_AND_EXCHANGE(3)
Impressum