#include <OVR_Threads.h>
Classes | |
struct | CreateParams |
Public Types | |
typedef int(* | ThreadFn )(Thread *pthread, void *h) |
enum | ThreadPriority { CriticalPriority, HighestPriority, AboveNormalPriority, NormalPriority, BelowNormalPriority, LowestPriority, IdlePriority } |
enum | ThreadState { NotRunning = 0, Running = 1, Suspended = 2 } |
Public Member Functions | |
virtual void | Exit (int exitCode=0) |
int | GetExitCode () const |
bool | GetExitFlag () const |
pthread_t | GetOSHandle () const |
ThreadId | GetThreadId () const |
ThreadState | GetThreadState () const |
bool | IsFinished () const |
bool | IsSuspended () const |
virtual void | OnExit () |
bool | Resume () |
virtual int | Run () |
void | SetExitFlag (bool exitFlag) |
virtual void | SetThreadName (const char *name) |
virtual bool | Start (ThreadState initialState=Running) |
bool | Suspend () |
Thread (UPInt stackSize=128 *1024, int processor=-1) | |
Thread (ThreadFn threadFunction, void *userHandle=0, UPInt stackSize=128 *1024, int processor=-1, ThreadState initialState=NotRunning) | |
Thread (const CreateParams ¶ms) | |
virtual | ~Thread () |
Static Public Member Functions | |
static void OVR_CDECL | FinishAllThreads () |
static int | GetCPUCount () |
static int | GetOSPriority (ThreadPriority) |
static bool | MSleep (unsigned msecs) |
static bool | Sleep (unsigned secs) |
Public Attributes | |
ThreadFn | ThreadFunction |
void * | UserHandle |
Protected Member Functions | |
void | FinishAndRelease () |
void | Init (const CreateParams ¶ms) |
int | PRun () |
Thread (const Thread &source) | |
Protected Attributes | |
int | ExitCode |
ThreadPriority | Priority |
int | Processor |
UPInt | StackSize |
AtomicInt< SInt32 > | SuspendCount |
AtomicInt< UInt32 > | ThreadFlags |
pthread_t | ThreadHandle |
Static Private Attributes | |
static pthread_attr_t | Attr |
static int | InitAttr = 0 |
Friends | |
void * | Thread_PthreadStartFn (void *phandle) |
Definition at line 186 of file OVR_Threads.h.
typedef int(* OVR::Thread::ThreadFn)(Thread *pthread, void *h) |
Definition at line 196 of file OVR_Threads.h.
CriticalPriority | |
HighestPriority | |
AboveNormalPriority | |
NormalPriority | |
BelowNormalPriority | |
LowestPriority | |
IdlePriority |
Definition at line 212 of file OVR_Threads.h.
Definition at line 204 of file OVR_Threads.h.
OVR::Thread::Thread | ( | UPInt | stackSize = 128 * 1024 , |
int | processor = -1 |
||
) |
Definition at line 381 of file OVR_ThreadsPthread.cpp.
OVR::Thread::Thread | ( | Thread::ThreadFn | threadFunction, |
void * | userHandle = 0 , |
||
UPInt | stackSize = 128 * 1024 , |
||
int | processor = -1 , |
||
Thread::ThreadState | initialState = NotRunning |
||
) |
Definition at line 390 of file OVR_ThreadsPthread.cpp.
OVR::Thread::Thread | ( | const CreateParams & | params | ) | [explicit] |
Definition at line 397 of file OVR_ThreadsPthread.cpp.
OVR::Thread::~Thread | ( | ) | [virtual] |
Definition at line 420 of file OVR_ThreadsPthread.cpp.
OVR::Thread::Thread | ( | const Thread & | source | ) | [inline, protected] |
Definition at line 384 of file OVR_Threads.h.
void OVR::Thread::Exit | ( | int | exitCode = 0 | ) | [virtual] |
Definition at line 744 of file OVR_ThreadsPthread.cpp.
void OVR::Thread::FinishAllThreads | ( | ) | [static] |
Definition at line 550 of file OVR_ThreadsPthread.cpp.
void OVR::Thread::FinishAndRelease | ( | ) | [protected] |
Definition at line 446 of file OVR_ThreadsPthread.cpp.
int OVR::Thread::GetCPUCount | ( | ) | [static] |
Definition at line 781 of file OVR_ThreadsPthread.cpp.
int OVR::Thread::GetExitCode | ( | ) | const [inline] |
Definition at line 311 of file OVR_Threads.h.
bool OVR::Thread::GetExitFlag | ( | ) | const |
Definition at line 576 of file OVR_ThreadsPthread.cpp.
pthread_t OVR::Thread::GetOSHandle | ( | ) | const [inline] |
Definition at line 316 of file OVR_Threads.h.
int OVR::Thread::GetOSPriority | ( | ThreadPriority | p | ) | [static] |
Definition at line 652 of file OVR_ThreadsPthread.cpp.
ThreadId OVR::Thread::GetThreadId | ( | ) | const [inline] |
Definition at line 322 of file OVR_Threads.h.
Definition at line 602 of file OVR_ThreadsPthread.cpp.
void OVR::Thread::Init | ( | const CreateParams & | params | ) | [protected] |
Definition at line 402 of file OVR_ThreadsPthread.cpp.
bool OVR::Thread::IsFinished | ( | ) | const |
Definition at line 592 of file OVR_ThreadsPthread.cpp.
bool OVR::Thread::IsSuspended | ( | ) | const |
Definition at line 597 of file OVR_ThreadsPthread.cpp.
bool OVR::Thread::MSleep | ( | unsigned | msecs | ) | [static] |
Definition at line 774 of file OVR_ThreadsPthread.cpp.
void OVR::Thread::OnExit | ( | ) | [virtual] |
Definition at line 440 of file OVR_ThreadsPthread.cpp.
int OVR::Thread::PRun | ( | ) | [protected] |
Definition at line 557 of file OVR_ThreadsPthread.cpp.
bool OVR::Thread::Resume | ( | ) |
Definition at line 737 of file OVR_ThreadsPthread.cpp.
int OVR::Thread::Run | ( | ) | [virtual] |
Reimplemented in OVR::OSX::DeviceManagerThread, OVR::Win32::DeviceManagerThread, and OVR::Linux::DeviceManagerThread.
Definition at line 435 of file OVR_ThreadsPthread.cpp.
void OVR::Thread::SetExitFlag | ( | bool | exitFlag | ) |
Definition at line 581 of file OVR_ThreadsPthread.cpp.
void OVR::Thread::SetThreadName | ( | const char * | name | ) | [inline, virtual] |
Definition at line 338 of file OVR_Threads.h.
bool OVR::Thread::Sleep | ( | unsigned | secs | ) | [static] |
Definition at line 768 of file OVR_ThreadsPthread.cpp.
bool OVR::Thread::Start | ( | ThreadState | initialState = Running | ) | [virtual] |
Definition at line 672 of file OVR_ThreadsPthread.cpp.
bool OVR::Thread::Suspend | ( | ) |
Definition at line 730 of file OVR_ThreadsPthread.cpp.
void* Thread_PthreadStartFn | ( | void * | phandle | ) | [friend] |
Definition at line 636 of file OVR_ThreadsPthread.cpp.
pthread_attr_t OVR::Thread::Attr [static, private] |
Definition at line 349 of file OVR_Threads.h.
int OVR::Thread::ExitCode [protected] |
Definition at line 374 of file OVR_Threads.h.
int OVR::Thread::InitAttr = 0 [static, private] |
Definition at line 348 of file OVR_Threads.h.
ThreadPriority OVR::Thread::Priority [protected] |
Definition at line 360 of file OVR_Threads.h.
int OVR::Thread::Processor [protected] |
Definition at line 359 of file OVR_Threads.h.
UPInt OVR::Thread::StackSize [protected] |
Definition at line 356 of file OVR_Threads.h.
AtomicInt<SInt32> OVR::Thread::SuspendCount [protected] |
Definition at line 355 of file OVR_Threads.h.
AtomicInt<UInt32> OVR::Thread::ThreadFlags [protected] |
Definition at line 354 of file OVR_Threads.h.
Definition at line 199 of file OVR_Threads.h.
pthread_t OVR::Thread::ThreadHandle [protected] |
Definition at line 370 of file OVR_Threads.h.
void* OVR::Thread::UserHandle |
Definition at line 201 of file OVR_Threads.h.