VR-Link API Documentation for HLA 4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Typedefs | Enumerations | Functions
vlThreadSysWrapper.h File Reference

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...
 

Detailed Description

This file contains wrappers for system thread calls.

Typedef Documentation

typedef void*(* DtThreadFunc)(void *)

Thread Function Prototype (same for Windows and POSIX threads)

Thread Handle is a windows specific device, pthreads uses the threadId for the same purposes.

typedef pthread_t DtThreadId

Enumeration Type Documentation

Enumerator
DtThreadSuccess 
DtThreadError 
DtThreadExitFailed 

Function Documentation

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


Document ID: Generated on Thu Oct 16 00:12:25 EDT 2025 from SVN revision 280738
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)