Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::atomic_flag_test,std::atomic_flag_test_explicit

      From cppreference.com
      <cpp‎ |atomic
       
       
      Concurrency support library
      Threads
      (C++11)
      (C++20)
      this_thread namespace
      (C++11)
      (C++11)
      (C++11)
      Cooperative cancellation
      Mutual exclusion
      Generic lock management
      (C++11)
      (C++11)
      (C++11)
      (C++11)
      Condition variables
      (C++11)
      Semaphores
      Latches and Barriers
      (C++20)
      (C++20)
      Futures
      (C++11)
      (C++11)
      (C++11)
      Safe reclamation
      Hazard pointers
      Atomic types
      (C++11)
      (C++20)
      Initialization of atomic types
      (C++11)(deprecated in C++20)
      (C++11)(deprecated in C++20)
      Memory ordering
      (C++11)(deprecated in C++26)
      Free functions for atomic operations
      Free functions for atomic flags
      atomic_flag_testatomic_flag_test_explicit
      (C++20)(C++20)
       
      Defined in header<atomic>
      bool atomic_flag_test(constvolatilestd::atomic_flag* object)noexcept;
      (1)(since C++20)
      bool atomic_flag_test(conststd::atomic_flag* object)noexcept;
      (2)(since C++20)
      bool atomic_flag_test_explicit(constvolatilestd::atomic_flag* object,
                                     std::memory_order order)noexcept;
      (3)(since C++20)
      bool atomic_flag_test_explicit(conststd::atomic_flag* object,
                                     std::memory_order order)noexcept;
      (4)(since C++20)

      Atomically reads the value of the*object and returns the value.

      1,2) The memory synchronization order isstd::memory_order_seq_cst.
      3,4) The memory synchronization order isorder.
      Iforder is one ofstd::memory_order::release andstd::memory_order::acq_rel, the behavior is undefined.

      Contents

      [edit]Parameters

      object - pointer to theatomic_flag object to read
      order - the memory synchronization ordering

      [edit]Return value

      The value atomically read.

      [edit]Notes

      Feature-test macroValueStdFeature
      __cpp_lib_atomic_flag_test201907L(C++20)std::atomic_flag::test

      [edit]Example

      This section is incomplete
      Reason: no example

      [edit]See also

      (C++20)
      atomically returns the value of the flag
      (public member function ofstd::atomic_flag)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/atomic/atomic_flag_test&oldid=159557"

      [8]ページ先頭

      ©2009-2025 Movatter.jp