VR-Link API Documentation for HLA 1516
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vlThreadSysWrapper.h
Go to the documentation of this file.
1 /*******************************************************************************
2  ** Copyright (c) 1992-2010 VT MAK
3  ** All rights reserved.
4  *******************************************************************************/
8 #pragma once
9 
10 #ifdef DtUSE_UTILITIES_NAMESPACE
11 namespace DtUSE_UTILITIES_NAMESPACE
12 {
13 #endif
14 
16 typedef void* (*DtThreadFunc)(void*);
17 
19 {
23 };
24 
25 #ifdef DtUSE_UTILITIES_NAMESPACE
26 }
27 #endif
28 
29 #ifdef _WIN32
30 
31 /****************************************************
32  WINDOWS WINDOWS WINDOWS WINDOWS
33 ****************************************************/
34 
37 #include <winsock2.h>
38 #include <ws2tcpip.h>
39 
41 #include <windows.h>
42 
43 #ifdef DtUSE_UTILITIES_NAMESPACE
44 namespace DtUSE_UTILITIES_NAMESPACE
45 {
46 #endif
47 
48 typedef HANDLE DtThreadHandle;
49 
52 typedef DWORD DtThreadId;
53 
54 #ifdef DtUSE_UTILITIES_NAMESPACE
55 }
56 #endif
57 
58 #else
59 
60 /****************************************************
61  POSIX POSIX POSIX POSIX
62 ****************************************************/
63 
64 #include <pthread.h>
65 #include <unistd.h>
66 #include <sched.h>
67 #include <errno.h>
68 
69 
70 #ifdef DtUSE_UTILITIES_NAMESPACE
71 namespace DtUSE_UTILITIES_NAMESPACE
72 {
73 #endif
74 
75 typedef pthread_t DtThreadId;
79 
80 #ifdef DtUSE_UTILITIES_NAMESPACE
81 }
82 #endif
83 
84 #endif
85 
86 
87 /****************************************************
89 ****************************************************/
90 
91 #ifdef DtUSE_UTILITIES_NAMESPACE
92 namespace DtUSE_UTILITIES_NAMESPACE
93 {
94 #endif
95 
96 
107 DtThreadHandle DtThreadCreate(DtThreadFunc runFunction, void* param, DtThreadId* threadId);
108 
109 
116 void DtThreadExit(void* exitCode);
117 
125 
133 
145 
153 void DtThreadCleanUp(DtThreadHandle threadHandle);
154 
155 
156 #ifdef DtUSE_UTILITIES_NAMESPACE
157 }
158 #endif
159 
160 
161 
162 
163 
164 
DtThreadHandle DtThreadCreate(DtThreadFunc runFunction, void *param, DtThreadId *threadId)
DtThreadHandle DtThreadCreate(DtThreadFunc runFunction, void* param, DtThreadId* threadId) PURPOSE: C...
void DtThreadCleanUp(DtThreadHandle threadHandle)
void DtThreadCleanUp(DtThreadHandle threadHandle) PURPOSE: Closes all local references to thread...
DtThreadStatus
Definition: vlThreadSysWrapper.h:18
DtThreadId DtGetThreadId()
DtThreadId DtGetThreadId() PURPOSE: Get the local Thread&#39;s ID INPUTS: NONE RETURNS: Local Thread Id...
void DtThreadExit(void *exitCode)
void DtThreadExit(void* exitCode) PURPOSE: Exits thread gracefully INPUTS: void* exitCode: - holds th...
Definition: vlThreadSysWrapper.h:21
DtThreadId DtThreadHandle
Thread Handle is a windows specific device, pthreads uses the threadId for the same purposes...
Definition: vlThreadSysWrapper.h:78
Definition: vlThreadSysWrapper.h:22
pthread_t DtThreadId
Definition: vlThreadSysWrapper.h:75
DtThreadStatus DtThreadStop(DtThreadHandle threadHandle)
DtThreadStatus DtThreadStop(DtThreadHandle threadHandle) PURPOSE: Terminate the specified thread INPU...
Definition: vlThreadSysWrapper.h:20
void *(* DtThreadFunc)(void *)
Thread Function Prototype (same for Windows and POSIX threads)
Definition: vlThreadSysWrapper.h:16
DtThreadStatus DtThreadJoin(DtThreadHandle threadHandle)
DtThreadStatus DtThreadJoin(DtThreadHandle threadHandle) PURPOSE: Put current thread to sleep until s...

Document ID: Generated on Tue Aug 10 00:12:31 EDT 2021 from SVN revision 232765
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)