Namespaces
Variants

std::stop_source:: stop_source

From cppreference.net
Concurrency support library
Threads
(C++11)
(C++20)
this_thread namespace
(C++11)
(C++11)
Cooperative cancellation
Mutual exclusion
Generic lock management
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) (C++20 이후)
explicit stop_source ( std:: nostopstate_t nss ) noexcept ;
(2) (C++20 이후)
stop_source ( const stop_source & other ) noexcept ;
(3) (C++20 이후)
stop_source ( stop_source && other ) noexcept ;
(4) (C++20 이후)

새로운 stop_source 객체를 생성합니다.

1) 새로운 중단 상태를 가진 stop_source 를 생성합니다.
2) 연관된 중단 상태(stop-state)가 없는 빈 stop_source 를 생성합니다.
3) 복사 생성자. other 와 동일한 중지 상태를 가지는 stop_source 를 생성합니다.
4) 이동 생성자. stop_source 의 연관된 중단 상태를 other 와 동일하게 구성하며, other 는 비워진 상태로 남습니다.

매개변수

nss - stop_source 를 생성하기 위한 std::nostopstate_t 플레이스홀더 객체
other - stop_source 객체를 생성하기 위한 다른 stop_source 객체

사후 조건

1) stop_possible() true 이고 stop_requested() false 입니다.
2) stop_possible() stop_requested() 모두 false 입니다.
3) * this other 는 동일한 연관된 중지 상태를 공유하며 동등하게 비교됩니다.
4) * this other 의 이전에 연관된 stop-state를 가지며, other. stop_possible ( ) false 입니다.

예외

1) std::bad_alloc 스톱 상태(stop-state)를 위한 메모리를 할당할 수 없는 경우.