1QB_ATOMIC_INT_COMPARE_AND_EXlCiHbAqNbGEP(r3o)grammeQrB'_sATMOaMnIuCa_lINT_COMPARE_AND_EXCHANGE(3)
2
3
4

NAME

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

SYNOPSIS

12       #include <qb/qbatomic.h>
13
14       int32_t qb_atomic_int_compare_and_exchange(
15           volatile int32_t QB_GNUC_MAY_ALIAS   *atomic,  /* a pointer to an integer */
16           int32_t                               oldval,  /* the assumed old value of *atomic */
17           int32_t                               newval   /* the new value of *atomic*/
18       );
19

PARAMS

21       atomic a pointer to an integer
22
23       oldval the assumed old value of *atomic
24
25       newval the new value of *atomic
26

DESCRIPTION

28       Also acts as a memory barrier.
29

RETURN VALUE

31       QB_TRUE, if *atomic was equal oldval. QB_FALSE otherwise.
32

SEE ALSO

34       qb_atomic_int_set(3), qb_atomic_int_get(3), qb_atomic_int_add(3),
35       qb_atomic_init(3), qb_atomic_pointer_get(3),
36       qb_atomic_int_exchange_and_add(3),
37       qb_atomic_pointer_compare_and_exchange(3), qb_atomic_pointer_set(3)
38
40       Copyright (C) 2003 Sebastian Wilhelmi
41
42
43
44LIBQB                             2023-07-Q2B1_ATOMIC_INT_COMPARE_AND_EXCHANGE(3)
Impressum