thread クラス

概要

実行のスレッドを表す。

構文

class thread;

ヘッダー

#include "tbb/compat/thread"

説明

thread クラスは、ネイティブスレッドに対するプラットフォームに依存しないインターフェイスを提供します。 インスタンスはスレッドを表します。プラットフォーム固有のスレッド制御は native_handle() メソッドを使用して行います。

メンバー

namespace std {    
    class thread {
    public:
    #if _WIN32||_WIN64
    typedef HANDLE native_handle_type;
    #else
    typedef pthread_t native_handle_type;
    #endif // _WIN32||_WIN64
    
    class id;
    
    thread();
    template <typename F> explicit thread(F f);
        template <typename F, typename X> thread(F f, X x);
            template <typename F, typename X, typename Y>
                thread (F f, X x, Y y);
                thread& operator=( thread& x);
                ~thread();
                
                bool joinable() const;
                void join();
                void detach();
                id get_id() const;
                native_handle_type native_handle();
                
                static unsigned hardware_concurrency();