Go to the source code of this file.
◆ ATOMIC_INIT
#define ATOMIC_INIT |
( |
|
i | ) |
�{ (i) } |
◆ atomic_read
#define atomic_read |
( |
|
v | ) |
((v)->counter) |
�* Read atomic variable �*
- Parameters
-
v | pointer of type atomic_t �* �* Atomically reads the value of @v. � |
◆ atomic_set
#define atomic_set |
( |
|
v, |
|
|
|
i |
|
) |
| (((v)->counter) = (i)) |
�* Set atomic variable �*
- Parameters
-
v | pointer of type atomic_t �* |
i | required value � |
◆ atomic_add()
static void atomic_add |
( |
int |
i, |
|
|
atomic_t * |
v |
|
) |
| |
|
inlinestatic |
�* Add to the atomic variable �*
- Parameters
-
i | integer value to add �* |
v | pointer of type atomic_t � |
References atomic_t::counter.
◆ atomic_add_negative()
static int atomic_add_negative |
( |
int |
i, |
|
|
atomic_t * |
v |
|
) |
| |
|
inlinestatic |
add and test if negative �*
�*
- Parameters
-
v | pointer of type atomic_t �* |
i | integer value to add �* �* Atomically adds @i to @v and returns true �* if the result is negative, or false when �* result is greater than or equal to zero. � |
References atomic_t::counter.
◆ atomic_dec()
decrement atomic variable �*
�*
- Parameters
-
v | pointer of type atomic_t �* �* Atomically decrements @v by 1. �Note that the guaranteed �* useful range of an atomic_t is only 24 bits. � |
References atomic_t::counter.
◆ atomic_dec_and_test()
static int atomic_dec_and_test |
( |
atomic_t * |
v | ) |
|
|
inlinestatic |
Decrement and test �*.
�*
- Parameters
-
v | pointer of type atomic_t �* �* Atomically decrements @v by 1 and �* returns true if the result is 0, or false for all other �* cases. � |
References atomic_t::counter.
◆ atomic_inc()
�* Increment atomic variable �*
- Parameters
-
v | pointer of type atomic_t �* �* Atomically increments @v by 1. � |
References atomic_t::counter.
◆ atomic_inc_and_test()
static int atomic_inc_and_test |
( |
atomic_t * |
v | ) |
|
|
inlinestatic |
Increment and test �*.
�*
- Parameters
-
v | pointer of type atomic_t �* �* Atomically increments @v by 1 �* and returns true if the result is zero, or false for all �* other cases. � |
References atomic_t::counter.
◆ atomic_sub()
static void atomic_sub |
( |
int |
i, |
|
|
atomic_t * |
v |
|
) |
| |
|
inlinestatic |
�* Subtract the atomic variable �*
- Parameters
-
i | integer value to subtract �* |
v | pointer of type atomic_t �* �* Atomically subtracts @i from @v. � |
References atomic_t::counter.
◆ atomic_sub_and_test()
static int atomic_sub_and_test |
( |
int |
i, |
|
|
atomic_t * |
v |
|
) |
| |
|
inlinestatic |
�* Subtract value from variable and test result �*
- Parameters
-
i | integer value to subtract �* |
v | pointer of type atomic_t �* �* Atomically subtracts @i from @v and returns �* true if the result is zero, or false for all �* other cases. � |
References atomic_t::counter.