![]() |
VR-Link API Documentation for DIS
|
This file contains wrappers for system thread calls. More...
Go to the source code of this file.
Typedefs | |
| typedef void *(* | DtThreadFunc )(void *) |
| Thread Function Prototype (same for Windows and POSIX threads) More... | |
| typedef pthread_t | DtThreadId |
| typedef DtThreadId | DtThreadHandle |
| Thread Handle is a windows specific device, pthreads uses the threadId for the same purposes. More... | |
Enumerations | |
| enum | DtThreadStatus { DtThreadSuccess, DtThreadError, DtThreadExitFailed } |
Functions | |
| DtThreadHandle | DtThreadCreate (DtThreadFunc runFunction, void *param, DtThreadId *threadId) |
| DtThreadHandle DtThreadCreate(DtThreadFunc runFunction, void* param, DtThreadId* threadId) PURPOSE: Creates a new thread specified by thread function pThreadFunc(pParam) Passes back a Thread ID in threadId. More... | |
| void | DtThreadExit (void *exitCode) |
| void DtThreadExit(void* exitCode) PURPOSE: Exits thread gracefully INPUTS: void* exitCode: - holds the thread return code on thread exit RETURNS: none More... | |
| DtThreadId | DtGetThreadId () |
| DtThreadId DtGetThreadId() PURPOSE: Get the local Thread's ID INPUTS: NONE RETURNS: Local Thread Id. More... | |
| DtThreadStatus | DtThreadJoin (DtThreadHandle threadHandle) |
| DtThreadStatus DtThreadJoin(DtThreadHandle threadHandle) PURPOSE: Put current thread to sleep until specified thread dies INPUTS: DtThreadHandle threadHandle: - Handle to the joining thread RETURNS: Return code of specified thread. More... | |
| DtThreadStatus | DtThreadStop (DtThreadHandle threadHandle) |
| DtThreadStatus DtThreadStop(DtThreadHandle threadHandle) PURPOSE: Terminate the specified thread INPUTS: DtThreadHandle threadHandle: Handle to the joining thread NOTE: - in general this function should not be used since it may cause deadlocks if the stopped thread holds a lock. More... | |
| void | DtThreadCleanUp (DtThreadHandle threadHandle) |
| void DtThreadCleanUp(DtThreadHandle threadHandle) PURPOSE: Closes all local references to thread. More... | |
This file contains wrappers for system thread calls.
| typedef void*(* DtThreadFunc)(void *) |
Thread Function Prototype (same for Windows and POSIX threads)
| typedef DtThreadId DtThreadHandle |
Thread Handle is a windows specific device, pthreads uses the threadId for the same purposes.
| typedef pthread_t DtThreadId |
| enum DtThreadStatus |
| DtThreadId DtGetThreadId | ( | ) |
DtThreadId DtGetThreadId() PURPOSE: Get the local Thread's ID INPUTS: NONE RETURNS: Local Thread Id.
| void DtThreadCleanUp | ( | DtThreadHandle | threadHandle | ) |
void DtThreadCleanUp(DtThreadHandle threadHandle) PURPOSE: Closes all local references to thread.
INPUTS: DtThreadHandle threadHandle: - Handle to the thread to clean up RETURNS: none NOTE: Thread will not be cleanly destroyed if references are left open.
| DtThreadHandle DtThreadCreate | ( | DtThreadFunc | runFunction, |
| void * | param, | ||
| DtThreadId * | threadId | ||
| ) |
DtThreadHandle DtThreadCreate(DtThreadFunc runFunction, void* param, DtThreadId* threadId) PURPOSE: Creates a new thread specified by thread function pThreadFunc(pParam) Passes back a Thread ID in threadId.
INPUTS: DtThreadFunc runFunction: - The address of the function within which to run the new thread. void* param: - The single parameter to the thread function. DtThreadId* threadId: - An OS specific thread identifier. RETURNS: Thread handle
| void DtThreadExit | ( | void * | exitCode | ) |
void DtThreadExit(void* exitCode) PURPOSE: Exits thread gracefully INPUTS: void* exitCode: - holds the thread return code on thread exit RETURNS: none
| DtThreadStatus DtThreadJoin | ( | DtThreadHandle | threadHandle | ) |
DtThreadStatus DtThreadJoin(DtThreadHandle threadHandle) PURPOSE: Put current thread to sleep until specified thread dies INPUTS: DtThreadHandle threadHandle: - Handle to the joining thread RETURNS: Return code of specified thread.
| DtThreadStatus DtThreadStop | ( | DtThreadHandle | threadHandle | ) |
DtThreadStatus DtThreadStop(DtThreadHandle threadHandle) PURPOSE: Terminate the specified thread INPUTS: DtThreadHandle threadHandle: Handle to the joining thread NOTE: - in general this function should not be used since it may cause deadlocks if the stopped thread holds a lock.
- safe if there are no synchronization dependencies - consider using a flag instead
RETURNS: DtThreadSuccess if thread halted successfully