std::stop_source:: stop_source
From cppreference.net
<
cpp
|
thread
|
stop source
C++
Concurrency support library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::stop_source
| Member functions | ||||
|
stop_source::stop_source
|
||||
| Modifiers | ||||
| Observers | ||||
| Non-member functions | ||||
| Helper tags | ||||
|
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)를 위한 메모리를 할당할 수 없는 경우.