Namespace this_thread contains global functions related to threading.
namespace std {
namespace this_thread {
thread::id get_id();
void yield();
void sleep( const tbb::tick_count::interval_t& );
}
}
| Member | Description |
|---|---|
| thread::id get_id() |
Returns: Id of the current thread. |
| void yield() |
Offers to suspend current thread so that another thread may run. |
| void sleep_for( const tick_count::interval_t & i) |
Current thread blocks for at least time interval i. Example
void Foo() {
// Sleep 30 seconds
std::this_thread::sleep_for( tbb::tick_count::interval_t(30) );
}
|