libstdc++: std::this_thread Namespace Reference

libstdc++

std::this_thread Namespace Reference
Concurrency » Threads

## Functions
thread::id | get_id () noexcept
template<typename _Rep, typename _Period>
void | sleep_for (const chrono::duration< _Rep, _Period > &__rtime)
template<typename _Clock, typename _Duration>
void | sleep_until (const chrono::time_point< _Clock, _Duration > &__atime)
void | yield () noexcept

## Detailed Description

ISO C++ 2011 namespace for interacting with the current thread.

C++11 30.3.2 [thread.thread.this] Namespace this_thread.

## Function Documentation

## ◆ get_id()

thread::id std::this_thread::get_id | ( |  | ) |
| inlinenoexcept

The unique identifier of the current thread.

Definition at line 361 of file std_thread.h.

## ◆ sleep_for()

template<typename _Rep, typename _Period>

void std::this_thread::sleep_for | ( | const chrono::duration< _Rep, _Period > & | __rtime | ) |
| inline

this_thread::sleep_for

Definition at line 65 of file this_thread_sleep.h.

Referenced by sleep_until().

## ◆ sleep_until()

template<typename _Clock, typename _Duration>

void std::this_thread::sleep_until | ( | const chrono::time_point< _Clock, _Duration > & | __atime | ) |
| inline

this_thread::sleep_until

Definition at line 85 of file this_thread_sleep.h.

References sleep_for().

## ◆ yield()

void std::this_thread::yield | ( |  | ) |
| inlinenoexcept

Allow the implementation to schedule a different thread.

Definition at line 374 of file std_thread.h.