23#ifndef INCLUDED_vrpn_Thread_h_GUID_A455652F_72CE_4F8A_859E_543489012D01
24#define INCLUDED_vrpn_Thread_h_GUID_A455652F_72CE_4F8A_859E_543489012D01
34#if defined(sgi) || (defined(_WIN32) && !defined(__CYGWIN__)) || \
35 defined(linux) || defined(__APPLE__)
36#define vrpn_THREADS_AVAILABLE
38#undef vrpn_THREADS_AVAILABLE
55#pragma set woff 1110, 1424, 3201
60#pragma reset woff 1110, 1424, 3201
73 bool reset(
int cNumResources = 1);
107 static usptr_t *ppaArena;
108 static void allocArena();
153 void handleLockResult_(
int result);
An RAII lock/guard class for vrpn_Semaphore.
SemaphoreGuard(vrpn_Semaphore &sem)
Constructor that locks (p) the semaphore.
bool locked() const
Checks to see if we locked.
int v()
Release of resource. ("up")
vrpn_Semaphore(int cNumResources=1)
constructor - mutex by default (0 is a sync primitive)
bool reset(int cNumResources=1)
routine to reset it (true on success, false on failure) (may create new semaphore)
int numResources()
read values
int condP()
Non-blocking attempt to acquire resource ("down")
int p()
Blocking acquire of resource. ("down")
static void * threadFuncShellPosix(void *pvThread)
static void threadFuncShell(void *pvThread)
static unsigned number_of_processors()
void(* pfThread)(vrpn_ThreadData &ThreadData)
vrpn_Thread(vrpn_THREAD_FUNC pfThread, vrpn_ThreadData td)
void userData(void *pvNewUserData)
const try_to_lock_t try_to_lock
Dummy variable to pass to SemaphoreGuard to indicate we only want a conditional lock.
bool vrpn_test_threads_and_semaphores(void)
void(* vrpn_THREAD_FUNC)(vrpn_ThreadData &threadData)
Header to minimally include windows.h.