40#ifndef LM_THREAD_THREAD_H_ 
   41#define LM_THREAD_THREAD_H_ 
   85    static void * start_thread(
void * obj);
 
 
  100#define PTHREAD_EXCEPTION_CHECK(pthread_call) {int _pthread_ret_=pthread_call; if (_pthread_ret_ != 0) throw lm::thread::PthreadException(_pthread_ret_,__FILE__,__LINE__);} 
  101#define PTHREAD_EXCEPTION_CHECK_NOTHROW(pthread_call) {int _pthread_ret_=pthread_call; if (_pthread_ret_ != 0) {fprintf(stderr, "%s:%d: Pthread error, returned %d\n", __FILE__, __LINE__, _pthread_ret_); abort();}} 
Exception(const char *message="")
Create an Exception.
Definition Exceptions.h:62
PthreadException(int error, const char *file, const int line)
Definition Thread.h:55
volatile bool running
Definition Thread.h:90
virtual void stop()
Joins the thread with the parent waiting if necessary.
Definition Thread.cpp:123
Thread()
Creates a pthread locking mechanism and initializes "Thread".
Definition Thread.cpp:48
virtual void wake()=0
Wakes a sleeping thead.
pthread_mutex_t controlMutex
Definition Thread.h:88
virtual ~Thread()
Destory the Thread.
Definition Thread.cpp:59
virtual pthread_t getId()
Returns the pthread based id for the Thread.
Definition Thread.h:76
virtual void start()
If no thread exists, creates a new thread and begins execution.
Definition Thread.cpp:87
pthread_t threadId
Definition Thread.h:89
virtual void setAffinity(int cpuNumber)
Binds the thread to a CPU core.
Definition Thread.cpp:64
int cpuNumber
Definition Thread.h:91
Definition Capsule.cpp:46