33 |
#include <pthread.h> |
#include <pthread.h> |
34 |
#include <errno.h> |
#include <errno.h> |
35 |
|
|
36 |
|
#include "Condition.h" |
37 |
|
|
38 |
namespace LinuxSampler { |
namespace LinuxSampler { |
39 |
|
|
40 |
/// Abstract base class for classes that need to run in an own thread. |
/// Abstract base class for classes that need to run in an own thread. |
53 |
virtual int Destructor(); //FIXME: should be private |
virtual int Destructor(); //FIXME: should be private |
54 |
virtual int Main() = 0; ///< This method needs to be implemented by the descendant and is the entry point for the new thread. FIXME: should be protected |
virtual int Main() = 0; ///< This method needs to be implemented by the descendant and is the entry point for the new thread. FIXME: should be protected |
55 |
private: |
private: |
56 |
|
pthread_attr_t __thread_attr; |
57 |
pthread_t __thread_id; |
pthread_t __thread_id; |
58 |
pthread_key_t __thread_destructor_key; |
pthread_key_t __thread_destructor_key; |
59 |
pthread_mutex_t __thread_state_mutex; |
Condition RunningCondition; |
|
pthread_cond_t __thread_start_condition; |
|
|
pthread_cond_t __thread_exit_condition; |
|
60 |
int PriorityMax; |
int PriorityMax; |
61 |
int PriorityDelta; |
int PriorityDelta; |
|
bool Running; |
|
62 |
bool isRealTime; |
bool isRealTime; |
63 |
bool bLockedMemory; |
bool bLockedMemory; |
64 |
}; |
}; |