std::stop_token:: stop_token
From cppreference.net
<
cpp
|
thread
|
stop token
C++
Concurrency support library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::stop_token
| Member functions | ||||
|
stop_token::stop_token
|
||||
| Modifiers | ||||
| Observers | ||||
| Non-member functions | ||||
|
stop_token
(
)
noexcept
;
|
(1) | (C++20 이후) |
|
stop_token
(
const
stop_token
&
other
)
noexcept
;
|
(2) | (C++20 이후) |
|
stop_token
(
stop_token
&&
other
)
noexcept
;
|
(3) | (C++20 이후) |
새로운
stop_token
객체를 생성합니다.
1)
연관된 중지 상태가 없는 빈
stop_token
을 생성합니다.
2)
복사 생성자.
stop_token
의 연관된 중단 상태를
other
와 동일하게 구성합니다.
3)
이동 생성자.
stop_token
을 생성하며, 연관된 중단 상태는
other
와 동일하게 설정됩니다;
other
는 빈 상태로 남게 됩니다.
매개변수
| other | - |
이
stop_token
객체를 생성하기 위한
다른
stop_token
객체
|
사후 조건
1)
stop_possible()
와
stop_requested()
모두
false
입니다.
2)
*
this
와
other
는 동일한 연관된 중지 상태를 공유하며 동등하게 비교됩니다.
3)
*
this
는
other
의 이전에 연결된 stop-state를 가지며,
other.
stop_possible
(
)
가
false
입니다.