The namespace this_thread
provides methods for dealing with the calling thread.
More...
Functions | |
thread::id | get_id () |
Return the thread ID of the calling thread. | |
void | yield () |
Yield execution to another thread. | |
template<class _Rep , class _Period > | |
void | sleep_for (const chrono::duration< _Rep, _Period > &aTime) |
Blocks the calling thread for a period of time. |
The namespace this_thread
provides methods for dealing with the calling thread.
void tthread::this_thread::sleep_for | ( | const chrono::duration< _Rep, _Period > & | aTime | ) | [inline] |
Blocks the calling thread for a period of time.
[in] | aTime | Minimum time to put the thread to sleep. Example usage:
// Sleep for 100 milliseconds this_thread::sleep_for(chrono::milliseconds(100)); |
void tthread::this_thread::yield | ( | ) | [inline] |
Yield execution to another thread.
Offers the operating system the opportunity to schedule another thread that is ready to run on the current processor.