23 #ifndef __MULTITHREAD_H_ 24 #define __MULTITHREAD_H_ 35 typedef void* (*ThreadEntryFunction)(
void* user_param );
104 static int SetPriority(
int priority, pthread_t* thread=NULL );
121 static void Yield(
unsigned int ms );
138 static bool SetAffinity(
unsigned int cpu, pthread_t* thread=NULL );
static void * DefaultEntry(void *param)
void *(* ThreadEntryFunction)(void *user_param)
Function pointer typedef representing a thread's main entry point.
Definition: Thread.h:35
static void Yield(unsigned int ms)
Whatever thread you are calling from, yield the processor for the specified number of milliseconds...
bool mThreadStarted
Definition: Thread.h:152
pthread_t * GetThreadID()
Get thread identififer.
Definition: Thread.h:126
static void InitRealtime()
Prime the system for realtime use.
static bool SetAffinity(unsigned int cpu, pthread_t *thread=NULL)
Lock the specified thread's affinity to a CPU core.
virtual ~Thread()
Destructor.
static int SetPriority(int priority, pthread_t *thread=NULL)
Set the priority level of the thread.
void StopThread()
Halt execution of the thread.
static int GetMaxPriority()
Get the maximum priority level available.
pthread_t mThreadID
Definition: Thread.h:151
bool SetPriorityLevel(int priority)
Set this thread's priority level.
static int GetMinPriority()
Get the minimum priority level avaiable.
static int GetPriority(pthread_t *thread=NULL)
Get the priority level of the thread.
int GetPriorityLevel()
Get this thread's priority level.
Thread class for launching an asynchronous operating-system dependent thread.
Definition: Thread.h:44
virtual void Run()
User-implemented thread main() function.
bool StartThread()
Start the thread.
bool LockAffinity(unsigned int cpu)
Lock this thread to a CPU core.
Thread()
Default constructor.
static int GetCPU()
Look up which CPU core the thread is running on.