meta data for this page
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
programming:c:atomic [2021/01/17 18:16] – created niziak | programming:c:atomic [2025/02/03 08:42] (current) – niziak | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== stdatomic.h ====== | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | ===== atomic_flag ===== | ||
+ | |||
+ | > '' | ||
+ | > It is used to provide synchronization within threads in programs. Unlike '' | ||
+ | > '' | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | |||
+ | <code c> | ||
+ | #include < | ||
+ | |||
+ | atomic_flag busy; | ||
+ | |||
+ | if (atomic_flag_test_and_set(& | ||
+ | return APP_ERR_BUSY; | ||
+ | } | ||
+ | ... | ||
+ | atomic_flag_clear(& | ||
+ | </ | ||
+ | |||
+ | ===== atomic vars ===== | ||
+ | |||
+ | Atomic variables are not guaranteed to be lock-free. It depends on implementation, | ||
+ | |||
+ | |||
+ | ===== others ===== | ||
+ | |||
+ | |||
[[https:// | [[https:// | ||
[[https:// | [[https:// | ||
[[https:// | [[https:// |