Share via


<thread> 함수

get_id

현재 실행 스레드를 고유하게 식별합니다.

thread::id this_thread::get_id() noexcept;

Return Value

현재 실행 스레드를 고유하게 식별하는 thread::id 형식의 개체입니다.

sleep_for

호출 스레드를 차단합니다.

template <class Rep,
class Period>
inline void sleep_for(const chrono::duration<Rep, Period>& Rel_time);

매개 변수

Rel_time
시간 간격을 지정하는 duration 개체입니다.

설명

이 함수는 Rel_time 지정된 시간 이상 호출 스레드를 차단합니다. 이 함수는 예외를 throw하지 않습니다.

sleep_until

최소한 지정된 시간까지 호출 스레드를 차단합니다.

template <class Clock, class Duration>
void sleep_until(const chrono::time_point<Clock, Duration>& Abs_time);

void sleep_until(const xtime *Abs_time);

매개 변수

Abs_time
특정 시점을 나타냅니다.

설명

이 함수는 예외를 throw하지 않습니다.

swap

thread 개체의 상태를 바꿉니다.

void swap(thread& Left, thread& Right) noexcept;

매개 변수

Left
왼쪽 thread 개체입니다.

Right
오른쪽 thread 개체입니다.

설명

함수는 Left.swap(Right)을 호출합니다.

yield

정상적인 경우라면 현재 스레드가 계속 실행되더라도 운영 체제에 다른 스레드를 실행할 것을 알립니다.

inline void yield() noexcept;

참고 항목

<thread>