Documentation Home >> Headers >> <thread> Header >> std::thread class

The std::thread class is used to manage a thread of execution. It provides a means of starting a new thread of execution and waiting for the completion of a thread of execution. It also provides a means for identifying, and other functions for managing threads of execution.

For details on the members, see std::thread class members.

class thread
    // Types
    class id;
    typedef implementation-defined

    // Construction and Destruction


    template<typename Callable>
    explicit thread(Callable func);

    template<typename Callable,typename Args...>
    thread(Callable func,Args... args);

    // Copying and Moving
    thread(thread const& other) = delete;
    thread(thread&& other);

    thread& operator=(thread const& other) = delete;
    thread& operator=(thread&& other);

    void swap(thread& other);

    void join();
    void detach();
    bool joinable() const;

    id get_id() const;

    native_handle_type native_handle();

    static unsigned hardware_concurrency();

void swap(thread& lhs,thread& rhs);

#include <thread>

See Also