std::atomic...ar_explicit(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

std::atomic_flag_clear,std::atomic_flag_clear_explicit πŸ’…

okay so this is the std::atomic...ar_explicit(3) page from the C++ Standard Libary manual, section 3 β€” yes, that’s the exact spelling in the header, no cap. Welcome to the group chat, bestie. ✨

✨ NAME ✨

std::atomic_flag_clear,std::atomic_flag_clear_explicit - std::atomic_flag_clear,std::atomic_flag_clear_explicit

🌸 Synopsis 🌸

here’s the exact code, periodt:

          Defined in header <atomic>
          void atomic_flag_clear( volatile std::atomic_flag* obj ) noexcept;
       (1) (since C++11)
          void atomic_flag_clear( std::atomic_flag* obj ) noexcept;
       (2) (since C++11)
          void atomic_flag_clear_explicit( volatile std::atomic_flag* obj,
                                           std::memory_order order )
       (3) (since C++11)
          noexcept;
          void atomic_flag_clear_explicit( std::atomic_flag* obj,
                                           std::memory_order order )
       (4) (since C++11)
          noexcept;

πŸŽ€ Parameters πŸŽ€

  • obj β€” pointer to std::atomic_flag to access 🫢
  • order β€” the memory synchronization ordering πŸŽ€

πŸ’… Notes πŸ’…

std::atomic_flag_clear and std::atomic_flag_clear_explicit can be implemented as obj->clear() and obj->clear(order) respectively. slay. πŸ’…

🌸 Defect reports 🌸

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

  • DR: LWG 2138 Β· Applied to: C++11 Β· Behavior as published: order could be std::memory_order_consume Β· Correct behavior: the behavior is undefined in this case.

🌈 See also 🌈

  • atomic_flag β€” the lock-free boolean atomic type (C++11) (class) πŸ‘‘
  • atomic_flag_test_and_set β€” atomically sets the flag to true and returns its previous value (C++11) (function) πŸ”₯
  • atomic_flag_test_and_set_explicit β€” atomically sets the flag to true and returns its previous value (C++11) (function) πŸ”₯
  • memory_order β€” defines memory ordering constraints for the given atomic operation (C++11) (enum) 🌈
  • C documentation for atomic_flag_clear, atomic_flag_clear_explicit πŸ“š

πŸ’– source: http://cppreference.com Β· version/date: 2024.06.10 Β· page: std::atomic...ar_explicit(3) β€” bye bestie, go clear those flags responsibly! 🫢

πŸ“¦ where this page comes from