]> pd.if.org Git - liblfds/blob - liblfds/liblfds6.0.1/test/src/abstraction_thread_wait.c
Initial import (all versions, including the new 7.1.0)
[liblfds] / liblfds / liblfds6.0.1 / test / src / abstraction_thread_wait.c
1 #include "internal.h"\r
2 \r
3 \r
4 \r
5 \r
6 \r
7 /****************************************************************************/\r
8 #if (defined _WIN32 && defined _MSC_VER && !defined WIN_KERNEL_BUILD)\r
9 \r
10   /* TRD : any Windows (user-mode) on any CPU with the Microsoft C compiler\r
11 \r
12            _WIN32             indicates 64-bit or 32-bit Windows\r
13            _MSC_VER           indicates Microsoft C compiler\r
14            !WIN_KERNEL_BUILD  indicates Windows user-mode\r
15   */\r
16 \r
17   void abstraction_thread_wait( thread_state_t thread_state )\r
18   {\r
19     WaitForSingleObject( thread_state, INFINITE );\r
20 \r
21     return;\r
22   }\r
23 \r
24 #endif\r
25 \r
26 \r
27 \r
28 \r
29 \r
30 /****************************************************************************/\r
31 #if (defined _WIN32 && defined _MSC_VER && defined WIN_KERNEL_BUILD)\r
32 \r
33   /* TRD : any Windows on any CPU with the Microsoft C compiler\r
34 \r
35            _WIN32            indicates 64-bit or 32-bit Windows\r
36            _MSC_VER          indicates Microsoft C compiler\r
37            WIN_KERNEL_BUILD  indicates Windows kernel\r
38   */\r
39 \r
40   void abstraction_thread_wait( thread_state_t thread_state )\r
41   {\r
42     KeWaitForSingleObject( thread_state, Executive, KernelMode, FALSE, NULL );\r
43 \r
44     return;\r
45   }\r
46 \r
47 #endif\r
48 \r
49 \r
50 \r
51 \r
52 \r
53 /****************************************************************************/\r
54 #if (defined __unix__)\r
55 \r
56   /* TRD : any UNIX on any CPU with any compiler\r
57 \r
58            I assumed pthreads is available on any UNIX.\r
59 \r
60            __unix__   indicates Solaris, Linux, HPUX, etc\r
61   */\r
62 \r
63   void abstraction_thread_wait( thread_state_t thread_state )\r
64   {\r
65     pthread_join( thread_state,  NULL );\r
66 \r
67     return;\r
68   }\r
69 \r
70 #endif\r
71 \r