Namespaces
Variants

std::jthread:: operator=

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
std:: jthread & operator = ( std:: jthread && other ) noexcept ;
(C++20 이후)

만약 * this 에 여전히 연결된 실행 중인 스레드가 있는 경우(즉, joinable ( ) == true ), request_stop ( ) 를 호출한 후 join ( ) 를 호출합니다. other 의 상태를 * this 에 할당하고 other 를 기본 생성된 상태로 설정합니다.

이 호출 이후, this - > get_id ( ) 는 호출 전 other. get_id ( ) 값과 동일해지며, 관련된 stop-state도 이동됩니다. 또한 other 는 더 이상 실행 스레드를 나타내지 않으며 어떤 stop-state도 가지지 않게 됩니다.

매개변수

other - another jthread object to assign to this jthread object

반환값

* this