]> pd.if.org Git - liblfds/blob - liblfds/liblfds7.0.0/test/src/test_porting_abstraction_layer_thread_wait.c
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds7.0.0 / test / src / test_porting_abstraction_layer_thread_wait.c
1 /***** includes *****/
2 #include "internal.h"
3
4
5
6
7
8 /****************************************************************************/
9 #if( defined _WIN32 && NTDDI_VERSION >= NTDDI_WINXP )
10
11   /* TRD : _WIN32         indicates 32-bit or 64-bit Windows
12            NTDDI_VERSION  indicates Windows version
13                             - WaitForSingleObject requires XP
14   */
15
16   #ifdef TEST_PAL_THREAD_WAIT
17     #error More than one porting abstraction layer matches current platform in test_porting_abstraction_layer_thread_wait.c
18   #endif
19
20   #define TEST_PAL_THREAD_WAIT
21
22   void test_pal_thread_wait( test_pal_thread_state_t thread_state )
23   {
24     WaitForSingleObject( thread_state, INFINITE );
25
26     return;
27   }
28
29 #endif
30
31
32
33
34
35 /****************************************************************************/
36 #if( _POSIX_THREADS > 0 )
37
38   /* TRD : POSIX threads
39
40            _POSIX_THREADS  indicates POSIX threads
41                            - pthread_join requires POSIX
42   */
43
44   #ifdef TEST_PAL_THREAD_WAIT
45     #error More than one porting abstraction layer matches current platform in test_porting_abstraction_layer_thread_wait.c
46   #endif
47
48   #define TEST_PAL_THREAD_WAIT
49
50   void test_pal_thread_wait( test_pal_thread_state_t thread_state )
51   {
52     pthread_join( thread_state, NULL );
53
54     return;
55   }
56
57 #endif
58
59
60
61
62
63 /****************************************************************************/
64 #if( !defined TEST_PAL_THREAD_WAIT )
65
66   #error test_pal_thread_wait() not implemented for this platform.
67
68 #endif
69