Allolib  1.0
C++ Components For Interactive Multimedia
al::Thread Class Reference

#include <C:/Users/Andres/source/repos/casm_viewer/external/tinc/external/allolib/include/al/system/al_Thread.hpp>

Inheritance diagram for al::Thread:
al::PeriodicThread

Public Member Functions

 Thread ()
 Create thread without starting.
 
 Thread (ThreadFunction &func)
 
 Thread (void *(*cFunc)(void *userData), void *userData)
 
 Thread (const Thread &other)
 Copy constructor.
 
ThreadjoinOnDestroy (bool v)
 Set whether thread will automatically join upon destruction.
 
Threadpriority (int v)
 Set thread priority. More...
 
bool start (ThreadFunction &func)
 Start executing thread function.
 
bool start (void *(*threadFunc)(void *userData), void *userData)
 Start executing thread C function with user data.
 
bool join ()
 Block the calling routine indefinitely until the thread terminates. More...
 
Threadoperator= (Thread other)
 

Static Public Member Functions

static void * current ()
 Return pointer to current OS thread object. More...
 

Protected Attributes

Impl * mImpl
 
CThreadFunction mCFunc
 
bool mJoinOnDestroy
 

Friends

void swap (Thread &a, Thread &b)
 

Detailed Description

Thread

Definition at line 78 of file al_Thread.hpp.

Constructor & Destructor Documentation

◆ Thread() [1/2]

al::Thread::Thread ( ThreadFunction func)
Parameters
[in]functhread function object

◆ Thread() [2/2]

al::Thread::Thread ( void *(*)(void *userData)  cFunc,
void *  userData 
)
Parameters
[in]cFuncthread C function
[in]userDatauser data passed to C function

Member Function Documentation

◆ current()

static void* al::Thread::current ( )
static

Return pointer to current OS thread object.

E.g., if using pthreads internally, will return the pthread_t.

◆ join()

bool al::Thread::join ( )

Block the calling routine indefinitely until the thread terminates.

This function suspends execution of the calling routine until the thread has terminated. It will return immediately if the thread was already terminated. A true return value signifies successful termination. A false return value indicates a problem with the wait call.

◆ priority()

Thread& al::Thread::priority ( int  v)

Set thread priority.

Parameters
[in]vpriority of thread in [0, 99]. A value greater than 0 makes the thread "real-time".

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