MPD  0.20.18
Public Member Functions | Static Public Member Functions
ThreadId Class Reference

A low-level identification for a thread. More...

#include <Id.hxx>

Public Member Functions

 ThreadId ()=default
 No initialisation. More...
 
constexpr ThreadId (pthread_t _id)
 
gcc_pure bool IsNull () const noexcept
 
gcc_pure bool operator== (const ThreadId &other) const noexcept
 
bool IsInside () const noexcept
 Check if this thread is the current thread. More...
 

Static Public Member Functions

static constexpr ThreadId Null () noexcept
 
static gcc_pure const ThreadId GetCurrent () noexcept
 Return the current thread's id . More...
 

Detailed Description

A low-level identification for a thread.

Designed to work with existing threads, such as the main thread. Mostly useful for debugging code.

Definition at line 36 of file Id.hxx.

Constructor & Destructor Documentation

◆ ThreadId() [1/2]

ThreadId::ThreadId ( )
default

No initialisation.

◆ ThreadId() [2/2]

constexpr ThreadId::ThreadId ( pthread_t  _id)
inline

Definition at line 52 of file Id.hxx.

Member Function Documentation

◆ GetCurrent()

static gcc_pure const ThreadId ThreadId::GetCurrent ( )
inlinestaticnoexcept

Return the current thread's id .

Definition at line 72 of file Id.hxx.

◆ IsInside()

bool ThreadId::IsInside ( ) const
inlinenoexcept

Check if this thread is the current thread.

Definition at line 94 of file Id.hxx.

◆ IsNull()

gcc_pure bool ThreadId::IsNull ( ) const
inlinenoexcept

Definition at line 64 of file Id.hxx.

◆ Null()

static constexpr ThreadId ThreadId::Null ( )
inlinestaticnoexcept

Definition at line 55 of file Id.hxx.

◆ operator==()

gcc_pure bool ThreadId::operator== ( const ThreadId other) const
inlinenoexcept

Definition at line 81 of file Id.hxx.


The documentation for this class was generated from the following file: