aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/mhd_threads.h
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2017-08-27 20:33:34 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2017-08-27 21:45:49 +0300
commit4fc783ecbd230c5c8e8ed0de1818b252070ef979 (patch)
tree9308a380fb4d3ed70588b0641362e8607d48631d /src/microhttpd/mhd_threads.h
parent3e7a55e9685eb8bf51b6307883b366b2dd38948a (diff)
downloadlibmicrohttpd-4fc783ecbd230c5c8e8ed0de1818b252070ef979.tar.gz
libmicrohttpd-4fc783ecbd230c5c8e8ed0de1818b252070ef979.zip
mhd_threads: added thread ID support
Diffstat (limited to 'src/microhttpd/mhd_threads.h')
-rw-r--r--src/microhttpd/mhd_threads.h26
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 */
125int 147int
126MHD_create_thread_ (MHD_thread_handle_ *thread, 148MHD_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 */
144int 166int
145MHD_create_named_thread_ (MHD_thread_handle_ *thread, 167MHD_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,