2 #include "libshared_porting_abstraction_layer_internal.h"
8 /****************************************************************************/
9 #if( defined _WIN32 && !defined KERNEL_MODE && NTDDI_VERSION >= NTDDI_WINXP )
11 #ifdef LIBSHARED_PAL_THREAD_WAIT
12 #error More than one porting abstraction layer matches current platform in "libshared_porting_abstraction_layer_thread_wait.c".
15 #define LIBSHARED_PAL_THREAD_WAIT
17 void libshared_pal_thread_wait( libshared_pal_thread_handle_t thread_handle )
19 // TRD : thread_handle can be any value in its range
21 WaitForSingleObject( thread_handle, INFINITE );
32 /****************************************************************************/
33 #if( defined _WIN32 && defined KERNEL_MODE && NTDDI_VERSION >= NTDDI_WINXP )
35 #ifdef LIBSHARED_PAL_THREAD_WAIT
36 #error More than one porting abstraction layer matches current platform in "libshared_porting_abstraction_layer_thread_wait.c".
39 #define LIBSHARED_PAL_THREAD_WAIT
41 void libshared_pal_thread_wait( libshared_pal_thread_handle_t thread_handle )
43 // TRD : thread_handle can be any value in its range
45 KeWaitForSingleObject( thread_handle, Executive, KernelMode, FALSE, NULL );
56 /****************************************************************************/
57 #if( defined _POSIX_THREADS && _POSIX_THREADS > 0 && !defined KERNEL_MODE )
59 #ifdef LIBSHARED_PAL_THREAD_WAIT
60 #error More than one porting abstraction layer matches current platform in "libshared_porting_abstraction_layer_thread_wait.c".
63 #define LIBSHARED_PAL_THREAD_WAIT
65 void libshared_pal_thread_wait( libshared_pal_thread_handle_t thread_handle )
67 // TRD : thread_handle can be any value in its range
69 pthread_join( thread_handle, NULL );
80 /****************************************************************************/
81 #if( defined __linux__ && defined KERNEL_MODE )
83 #ifdef LIBSHARED_PAL_THREAD_WAIT
84 #error More than one porting abstraction layer matches current platform in "libshared_porting_abstraction_layer_thread_wait.c".
87 #define LIBSHARED_PAL_THREAD_WAIT
89 void libshared_pal_thread_wait( libshared_pal_thread_handle_t thread_handle )
91 // TRD : thread_handle can be any value in its range
93 /* TRD : turns out this function does not exist in the linux kernel
94 you have to manage your own inter-thread sync
95 that breaks the lfds abstraction for thread start/wait
96 so this isn't going to get fixed in time for this release
97 leaving the function here so compilation will pass
109 /****************************************************************************/
110 #if( !defined LIBSHARED_PAL_THREAD_WAIT )
112 #error No matching porting abstraction layer in "libshared_porting_abstraction_layer_thread_wait.c".