36 #define OVR_WAIT_INFINITE 0xFFFFFFFF
39 #ifdef OVR_ENABLE_THREADS
53 class WaitConditionImpl;
73 Mutex(
bool recursive = 1);
149 void updateState(
bool newState,
bool newTemp,
bool mustNotify);
187 #define OVR_THREAD_STARTED 0x01
189 #define OVR_THREAD_FINISHED 0x02
191 #define OVR_THREAD_START_SUSPENDED 0x08
194 #define OVR_THREAD_EXIT 0x10
255 Thread(
UPInt stackSize = 128 * 1024,
int processor = -1);
292 virtual void Exit(
int exitCode=0);
324 #if defined(OVR_OS_WIN32)
330 #if defined(OVR_OS_WIN32)
340 static bool Sleep(
unsigned secs);
342 static bool MSleep(
unsigned msecs);
346 #if defined(OVR_OS_WIN32)
353 #if defined(OVR_OS_WIN32)
354 friend unsigned WINAPI Thread_Win32StartFn(
void *pthread);
373 #if defined(OVR_OS_WIN32)
378 void CleanupSystemThread();
406 #endif // OVR_ENABLE_THREADS
407 #endif // OVR_Threads_h
#define OVR_WAIT_INFINITE
AtomicInt< SInt32 > SuspendCount
static void OVR_CDECL FinishAllThreads()
static bool MSleep(unsigned msecs)
bool IsLockedByAnotherThread()
WaitCondition StateWaitCondition
virtual void SetThreadName(const char *name)
static pthread_attr_t Attr
bool Wait(unsigned delay=OVR_WAIT_INFINITE)
ThreadState GetThreadState() const
Event(bool setInitially=0)
void updateState(bool newState, bool newTemp, bool mustNotify)
Thread(UPInt stackSize=128 *1024, int processor=-1)
pthread_t GetOSHandle() const
virtual void Exit(int exitCode=0)
static bool Sleep(unsigned secs)
static int GetOSPriority(ThreadPriority)
WaitConditionImpl * pImpl
CreateParams(ThreadFn func=0, void *hand=0, UPInt ssize=128 *1024, int proc=-1, ThreadState state=NotRunning, ThreadPriority prior=NormalPriority)
virtual bool Start(ThreadState initialState=Running)
Thread(const Thread &source)
ThreadId GetThreadId() const
void SetExitFlag(bool exitFlag)
AtomicInt< UInt32 > ThreadFlags
void Init(const CreateParams ¶ms)
ThreadId GetCurrentThreadId()
bool Wait(Mutex *pmutex, unsigned delay=OVR_WAIT_INFINITE)
friend void * Thread_PthreadStartFn(void *phandle)
int(* ThreadFn)(Thread *pthread, void *h)
unsigned long int pthread_t