diff options
Diffstat (limited to 'src/microhttpd/mhd_threads.h')
-rw-r--r-- | src/microhttpd/mhd_threads.h | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/microhttpd/mhd_threads.h b/src/microhttpd/mhd_threads.h index 988344b6..49bd77b8 100644 --- a/src/microhttpd/mhd_threads.h +++ b/src/microhttpd/mhd_threads.h | |||
@@ -86,6 +86,28 @@ | |||
86 | #endif | 86 | #endif |
87 | 87 | ||
88 | #if defined(MHD_USE_POSIX_THREADS) | 88 | #if defined(MHD_USE_POSIX_THREADS) |
89 | typedef pthread_t MHD_thread_ID_; | ||
90 | #elif defined(MHD_USE_W32_THREADS) | ||
91 | typedef DWORD MHD_thread_ID_; | ||
92 | #endif | ||
93 | |||
94 | #if defined(MHD_USE_POSIX_THREADS) | ||
95 | union _MHD_thread_handle_ID_ | ||
96 | { | ||
97 | MHD_thread_handle_ handle; | ||
98 | MHD_thread_ID_ ID; | ||
99 | }; | ||
100 | typedef union _MHD_thread_handle_ID_ MHD_thread_handle_ID_; | ||
101 | #elif defined(MHD_USE_W32_THREADS) | ||
102 | struct _MHD_thread_handle_ID_ | ||
103 | { | ||
104 | MHD_thread_handle_ handle; | ||
105 | MHD_thread_ID_ ID; | ||
106 | }; | ||
107 | typedef struct _MHD_thread_handle_ID_ MHD_thread_handle_ID_; | ||
108 | #endif | ||
109 | |||
110 | #if defined(MHD_USE_POSIX_THREADS) | ||
89 | /** | 111 | /** |
90 | * Wait until specified thread is ended and free thread handle on success. | 112 | * Wait until specified thread is ended and free thread handle on success. |
91 | * @param thread handle to watch | 113 | * @param thread handle to watch |
@@ -123,7 +145,7 @@ typedef MHD_THRD_RTRN_TYPE_ | |||
123 | * @return non-zero on success; zero otherwise | 145 | * @return non-zero on success; zero otherwise |
124 | */ | 146 | */ |
125 | int | 147 | int |
126 | MHD_create_thread_ (MHD_thread_handle_ *thread, | 148 | MHD_create_thread_ (MHD_thread_handle_ID_ *thread, |
127 | size_t stack_size, | 149 | size_t stack_size, |
128 | MHD_THREAD_START_ROUTINE_ start_routine, | 150 | MHD_THREAD_START_ROUTINE_ start_routine, |
129 | void *arg); | 151 | void *arg); |
@@ -142,7 +164,7 @@ MHD_create_thread_ (MHD_thread_handle_ *thread, | |||
142 | * @return non-zero on success; zero otherwise | 164 | * @return non-zero on success; zero otherwise |
143 | */ | 165 | */ |
144 | int | 166 | int |
145 | MHD_create_named_thread_ (MHD_thread_handle_ *thread, | 167 | MHD_create_named_thread_ (MHD_thread_handle_ID_ *thread, |
146 | const char* thread_name, | 168 | const char* thread_name, |
147 | size_t stack_size, | 169 | size_t stack_size, |
148 | MHD_THREAD_START_ROUTINE_ start_routine, | 170 | MHD_THREAD_START_ROUTINE_ start_routine, |