std::thread::get_id

From Cppreference

Jump to: navigation, search
thread::id get_id() const;
(C++11 feature)

Returns a value of std::thread::id identifying the thread associated with *this.

Contents

[edit] Parameters

(none)

[edit] Return value

a value of type std::thread::id identifying the thread associated with *this. If there is no thread associated, default constructed std::thread::id is returned.

[edit] Exceptions

noexcept specification:  
noexcept

  (C++11 feature)

[edit] Example

[edit] See also

joinable
checks whether the thread is joinable, i.e. potentially running in parallel context
(public member function)