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

SYNOPSIS

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

PARAMS

20       atomic a pointer to an integer
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. QB_FALSE otherwise.
31

SEE ALSO

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