Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::stop_source::stop_source

      From cppreference.com
      <cpp‎ |thread‎ |stop source
       
       
      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
       
       
      stop_source();
      (1)(since C++20)
      explicit stop_source(std::nostopstate_t nss)noexcept;
      (2)(since C++20)
      stop_source(const stop_source& other)noexcept;
      (3)(since C++20)
      stop_source( stop_source&& other)noexcept;
      (4)(since C++20)

      Constructs a newstop_source object.

      1) Constructs astop_source with new stop-state.
      2) Constructs an emptystop_source with no associated stop-state.
      3) Copy constructor. Constructs astop_source whose associated stop-state is the same as that ofother.
      4) Move constructor. Constructs astop_source whose associated stop-state is the same as that ofother;other is left empty.

      [edit]Parameters

      nss - anstd::nostopstate_t placeholder object to construct an emptystop_source
      other - anotherstop_source object to construct thisstop_source object with

      [edit]Postconditions

      1)stop_possible() istrue andstop_requested() isfalse.
      2)stop_possible() andstop_requested() are bothfalse.
      3)*this andother share the same associated stop-state and compare equal.
      4)*this hasother's previously associated stop-state, andother.stop_possible() isfalse.

      [edit]Exceptions

      1)std::bad_alloc if memory could not be allocated for the stop-state.
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/thread/stop_source/stop_source&oldid=161262"

      [8]ページ先頭

      ©2009-2025 Movatter.jp