Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
Loading...
Searching...
No Matches
roc::core::Thread Class Referenceabstract

Base class for thread objects. More...

#include <thread.h>

Inheritance diagram for roc::core::Thread:
roc::core::NonCopyable< Thread > roc::ctl::ControlTaskQueue roc::netio::NetworkLoop

Public Member Functions

bool joinable () const
 Check if thread was started and can be joined.
 
bool start ()
 Start thread.
 
void join ()
 Join thread.
 

Static Public Member Functions

static uint64_t get_pid ()
 Get numeric identifier of current process.
 
static uint64_t get_tid ()
 Get numeric identifier of current thread.
 
static bool set_realtime ()
 Raise current thread priority to realtime.
 

Protected Member Functions

virtual void run ()=0
 Method to be executed in thread.
 

Detailed Description

Base class for thread objects.

Definition at line 26 of file thread.h.

Member Function Documentation

◆ get_pid()

static uint64_t roc::core::Thread::get_pid ( )
static

Get numeric identifier of current process.

◆ get_tid()

static uint64_t roc::core::Thread::get_tid ( )
static

Get numeric identifier of current thread.

◆ join()

void roc::core::Thread::join ( )

Join thread.

Remarks
Blocks until run() returns and thread terminates.

◆ joinable()

bool roc::core::Thread::joinable ( ) const

Check if thread was started and can be joined.

Returns
true if start() was called and join() was not called yet.

◆ run()

virtual void roc::core::Thread::run ( )
protectedpure virtual

Method to be executed in thread.

◆ set_realtime()

static bool roc::core::Thread::set_realtime ( )
static

Raise current thread priority to realtime.

◆ start()

bool roc::core::Thread::start ( )

Start thread.

Remarks
Executes run() in new thread.

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