53 #include "system/compat/SystemCompat.h"
54 using namespace ::br::pucrio::telemidia::ginga::core::system::compat;
70 pthread_mutex_t threadMutex;
72 bool isThreadSleeping;
73 pthread_mutex_t threadFlagMutex;
74 pthread_cond_t threadFlagConditionVariable;
77 pthread_mutex_t threadFlagMutexLockUntilSignal;
78 pthread_cond_t threadFlagCVLockUntilSignal;
81 pthread_mutex_t threadIdMutex;
90 static void*
function(
void* ptr);
95 virtual void startThread();
96 bool sleep(
long int seconds);
97 bool mSleep(
long int milliseconds);
101 void waitForUnlockCondition();
102 bool unlockConditionSatisfied();
105 static void mutexInit(pthread_mutex_t* mutex,
bool recursive=
false);
106 static void mutexDestroy(pthread_mutex_t* mutex);
107 static void mutexLock(pthread_mutex_t* mutex);
108 static void mutexUnlock(pthread_mutex_t* mutex);
111 static void condInit(
112 pthread_cond_t* cond,
const pthread_condattr_t * attr);
114 static void condDestroy(pthread_cond_t* cond);
115 static void condWait(pthread_cond_t* cond, pthread_mutex_t* mutex);
116 static void condSignal(pthread_cond_t* cond);
119 static void startNewThread(
void* (*funcion) (
void*),
void* ptr);
129 #endif //__THREAD_H__