標準ライブラリヘッダ <thread>
提供: cppreference.com
このヘッダはスレッドサポートライブラリの一部です。
クラス | ||
| (C++11) |
別のスレッドを管理します (クラス) | |
| (C++20) |
自動合流とキャンセルをサポートする std::thread (クラス) | |
関数 | ||
| (C++11) |
std::swap アルゴリズムの特殊化 (関数テンプレート) | |
2つの thread::id オブジェクトを比較します (関数) | ||
thread::id オブジェクトをシリアライズします (関数テンプレート) | ||
| std::hash の特殊化 (クラステンプレートの特殊化) | ||
名前空間 | ||
this_thread
|
カレントスレッドにアクセスする関数を提供します | |
関数 | ||
| 名前空間
std::this_thread で定義 | ||
| (C++11) |
処理系にスレッドの切り替えを提案します (関数) | |
| (C++11) |
現在のスレッドのスレッド id を返します (関数) | |
| (C++11) |
指定された時間、現在のスレッドの実行を停止します (関数) | |
| (C++11) |
指定された時刻まで現在のスレッドの実行を停止します (関数) | |
[編集] 概要
namespace std { class thread; void swap(thread& x, thread& y) noexcept; bool operator==(thread::id x, thread::id y) noexcept; bool operator!=(thread::id x, thread::id y) noexcept; bool operator<(thread::id x, thread::id y) noexcept; bool operator<=(thread::id x, thread::id y) noexcept; bool operator>(thread::id x, thread::id y) noexcept; bool operator>=(thread::id x, thread::id y) noexcept; template<class CharT, class Traits> basic_ostream<CharT, Traits>& operator<<(basic_ostream<CharT, Traits>& out, thread::id id); template <class T> struct hash; template <> struct hash<thread::id>; namespace this_thread { thread::id get_id() noexcept; void yield() noexcept; template <class Clock, class Duration> void sleep_until(const chrono::time_point<Clock, Duration>& abs_time); template <class Rep, class Period> void sleep_for(const chrono::duration<Rep, Period>& rel_time); } }
[編集] クラス std::thread
class thread { public: // types: class id; typedef /*implementation-defined*/ native_handle_type; // construct/copy/destroy: thread() noexcept; template <class F, class ...Args> explicit thread(F&& f, Args&&... args); ~thread(); thread(const thread&) = delete; thread(thread&&) noexcept; thread& operator=(const thread&) = delete; thread& operator=(thread&&) noexcept; // members: void swap(thread&) noexcept; bool joinable() const noexcept; void join(); void detach(); id get_id() const noexcept; native_handle_type native_handle(); // static members: static unsigned hardware_concurrency() noexcept; };
[編集] クラス std::thread::id
class thread::id { public: id() noexcept; };