libcmutils 0.6.5
Multi-platform C99 utility library
Loading...
Searching...
No Matches

Platform independent thread object. More...

Data Fields

CMBool(* Start )(CMUTIL_Thread *thread)
 Starts this thread.
 
void *(* Join )(CMUTIL_Thread *thread)
 Join this thread.
 
CMBool(* IsRunning )(const CMUTIL_Thread *thread)
 This thread is running or not.
 
uint32_t(* GetId )(const CMUTIL_Thread *thread)
 Get the ID of this thread. The returned ID is not the system thread ID, just an internal thread index.
 
const char *(* GetName )(const CMUTIL_Thread *thread)
 Get the name of this thread.
 

Detailed Description

Platform independent thread object.

Field Documentation

◆ Start

CMBool(* CMUTIL_Thread::Start) (CMUTIL_Thread *thread)

Starts this thread.

This function creates a new thread which is not detached, so the created thread must be joined by calling Join method.

Parameters
threadThis thread object.
Returns
This thread has been started successfully or not.

◆ Join

void *(* CMUTIL_Thread::Join) (CMUTIL_Thread *thread)

Join this thread.

This function joins this thread and cleans up its resources, including this thread object, so these references must not be used after calling this method. Every thread that been created by this library must be joined by calling this method.

Parameters
threadThis thread object.
Returns
Thread return value.

◆ IsRunning

CMBool(* CMUTIL_Thread::IsRunning) (const CMUTIL_Thread *thread)

This thread is running or not.

Parameters
threadThis thread object.
Returns
CMTrue if this thread is running, CMFalse if this thread is not running.

◆ GetId

uint32_t(* CMUTIL_Thread::GetId) (const CMUTIL_Thread *thread)

Get the ID of this thread. The returned ID is not the system thread ID, just an internal thread index.

Parameters
threadThis thread object.
Returns
ID of this thread.

◆ GetName

const char *(* CMUTIL_Thread::GetName) (const CMUTIL_Thread *thread)

Get the name of this thread.

Parameters
threadThis thread object.
Returns
Name of this thread. It belongs to the thread object.

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