diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-08-27 20:48:15 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2017-08-27 21:45:50 +0300 |
commit | 953942677b185da6bf5a66adbf968446dd901841 (patch) | |
tree | 29f08984bd58ab82f0c6997cd74c8cb003444fc2 | |
parent | 4fc783ecbd230c5c8e8ed0de1818b252070ef979 (diff) | |
download | libmicrohttpd-953942677b185da6bf5a66adbf968446dd901841.tar.gz libmicrohttpd-953942677b185da6bf5a66adbf968446dd901841.zip |
mhd_threads: added MHD_thread_ID_match_current_()
-rw-r--r-- | src/microhttpd/mhd_threads.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/microhttpd/mhd_threads.h b/src/microhttpd/mhd_threads.h index 49bd77b8..d5424659 100644 --- a/src/microhttpd/mhd_threads.h +++ b/src/microhttpd/mhd_threads.h | |||
@@ -123,6 +123,22 @@ | |||
123 | #define MHD_join_thread_(thread) (WAIT_OBJECT_0 == WaitForSingleObject((thread), INFINITE) ? (CloseHandle((thread)), !0) : 0) | 123 | #define MHD_join_thread_(thread) (WAIT_OBJECT_0 == WaitForSingleObject((thread), INFINITE) ? (CloseHandle((thread)), !0) : 0) |
124 | #endif | 124 | #endif |
125 | 125 | ||
126 | #if defined(MHD_USE_POSIX_THREADS) | ||
127 | /** | ||
128 | * Check whether provided thread ID match current thread. | ||
129 | * @param ID thread ID to match | ||
130 | * @return nonzero on match, zero otherwise | ||
131 | */ | ||
132 | #define MHD_thread_ID_match_current_(ID) (pthread_equal((ID), pthread_self())) | ||
133 | #elif defined(MHD_USE_W32_THREADS) | ||
134 | /** | ||
135 | * Check whether provided thread ID match current thread. | ||
136 | * @param ID thread ID to match | ||
137 | * @return nonzero on match, zero otherwise | ||
138 | */ | ||
139 | #define MHD_thread_ID_match_current_(ID) (GetCurrentThreadId() == (ID)) | ||
140 | #endif | ||
141 | |||
126 | /** | 142 | /** |
127 | * Signature of main function for a thread. | 143 | * Signature of main function for a thread. |
128 | * | 144 | * |