this_thread 名前空間には、スレッド化に関連するグローバル関数が含まれます。
namespace std { namespace this_thread { thread::id get_id(); void yield(); void sleep( const tbb::tick_count::interval_t& ); } }
メンバー | 説明 |
---|---|
thread::id get_id() | 戻り値: 現在のスレッドの ID。 |
void yield() | 別のスレッドが実行できるように現在のスレッドを休止します。 |
void sleep_for( const tick_count::interval_t & i) | 現在のスレッドを少なくとも i 秒間ブロックします。 サンプル void Foo() { // 30 秒スリープ std::this_thread::sleep_for( tbb::tick_count::interval_t(30) ); } |