Some convenience functions are defined that allow you to
perform atomic operations (i.e., operations that are
guaranteed to be indivisible or uninterruptible).
Using these functions alleviates the need to disable and enable
interrupts around certain small, well-defined operations with variables.
QNX Neutrino defines the following in <atomic.h>:
C11 defines these in <stdatomic.h>:
- atomic_compare_exchange_strong(), atomic_compare_exchange_strong_explicit(), atomic_compare_exchange_weak(), atomic_compare_exchange_weak_explicit()
- atomic_exchange(), atomic_exchange_explicit()
- atomic_fetch_add(), atomic_fetch_add_explicit()
- atomic_fetch_and(), atomic_fetch_and_explicit()
- atomic_fetch_or(), atomic_fetch_or_explicit()
- atomic_fetch_sub(), atomic_fetch_sub_explicit()
- atomic_fetch_xor(), atomic_fetch_xor_explicit()
- atomic_flag_clear(), atomic_flag_clear_explicit()
- atomic_flag_test_and_set(), atomic_flag_test_and_set_explicit()
- atomic_init()
- atomic_is_lock_free()
- atomic_load(), atomic_load_explicit()
- atomic_signal_fence()
- atomic_store(), atomic_store_explicit()
- atomic_thread_fence()
See the QNX Neutrino C Library Reference for more information.