18 #ifndef osapi_thread_h
19 #define osapi_thread_h
23 #include "osapi/osapi_dll.h"
44 #define OSAPI_ThreadHandle pthread_t
45 #define OSAPI_ThreadId pthread_t
46 #elif OSAPI_PLATFORM == OSAPI_PLATFORM_WINDOWS
49 #define OSAPI_ThreadHandle HANDLE
50 #define OSAPI_ThreadId HANDLE
51 #elif OSAPI_PLATFORM == OSAPI_PLATFORM_STOS
52 #define OSAPI_ThreadHandle RTI_INT32
53 #define OSAPI_ThreadId RTI_INT32
54 #elif OSAPI_PLATFORM == OSAPI_PLATFORM_STELLARIS
55 #define OSAPI_ThreadHandle RTI_INT32
56 #define OSAPI_ThreadId RTI_INT32
57 #elif OSAPI_PLATFORM == OSAPI_PLATFORM_FREERTOS
58 #ifndef INC_FREERTOS_H
64 #define OSAPI_ThreadHandle xTaskHandle
65 #define OSAPI_ThreadId xTaskHandle
66 #elif OSAPI_PLATFORM == OSAPI_PLATFORM_VXWORKS
67 #define OSAPI_ThreadId int
68 #define OSAPI_ThreadHandle int
70 #error "thread handle not ported"
76 #define OSAPI_THREAD_PRIORITY_LOW -1
77 #define OSAPI_THREAD_PRIORITY_BELOW_NORMAL -2
78 #define OSAPI_THREAD_PRIORITY_NORMAL -3
79 #define OSAPI_THREAD_PRIORITY_ABOVE_NORMAL -4
80 #define OSAPI_THREAD_PRIORITY_HIGH -5
82 #define OSAPI_THREAD_USE_OSDEFAULT_STACKSIZE 0
92 #define OSAPI_THREAD_DEFAULT_OPTIONS 0x00
96 #define OSAPI_THREAD_FLOATING_POINT 0x01
100 #define OSAPI_THREAD_STDIO 0x02
104 #define OSAPI_THREAD_REALTIME_PRIORITY 0x08
108 #define OSAPI_THREAD_PRIORITY_ENFORCE 0x10
112 #define OSAPI_THREAD_CANCEL_ASYNCHRONOUS 0x20
117 struct OSAPI_ThreadProperty
120 RTI_UINT32 stack_size;
125 OSAPI_ThreadOptions options;
131 #define OSAPI_THREAD_PROPERTY_DEFAULT \
133 OSAPI_THREAD_USE_OSDEFAULT_STACKSIZE, \
134 OSAPI_THREAD_PRIORITY_NORMAL, \
135 OSAPI_THREAD_DEFAULT_OPTIONS \
138 #define OSAPI_ThreadProperty_INITIALIZER OSAPI_THREAD_PROPERTY_DEFAULT
164 FUNCTION_SHOULD_TYPEDEF(
194 MUST_CHECK_RETURN OSAPIDllExport
RTI_BOOL
207 MUST_CHECK_RETURN OSAPIDllExport
RTI_BOOL
219 MUST_CHECK_RETURN OSAPIDllExport
RTI_BOOL
254 MUST_CHECK_RETURN OSAPIDllExport
struct OSAPI_Thread*
256 const struct OSAPI_ThreadProperty *properties,
270 OSAPIDllExport OSAPI_ThreadId