gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libmicrohttpd] 02/03: mhd_threads: added MHD_thread_ID_mat


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] 02/03: mhd_threads: added MHD_thread_ID_match_current_()
Date: Sun, 27 Aug 2017 20:46:57 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 953942677b185da6bf5a66adbf968446dd901841
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Sun Aug 27 20:48:15 2017 +0300

    mhd_threads: added MHD_thread_ID_match_current_()
---
 src/microhttpd/mhd_threads.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

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 @@
 #define MHD_join_thread_(thread) (WAIT_OBJECT_0 == 
WaitForSingleObject((thread), INFINITE) ? (CloseHandle((thread)), !0) : 0)
 #endif
 
+#if defined(MHD_USE_POSIX_THREADS)
+/**
+ * Check whether provided thread ID match current thread.
+ * @param ID thread ID to match
+ * @return nonzero on match, zero otherwise
+ */
+#define MHD_thread_ID_match_current_(ID) (pthread_equal((ID), pthread_self()))
+#elif defined(MHD_USE_W32_THREADS)
+/**
+ * Check whether provided thread ID match current thread.
+ * @param ID thread ID to match
+ * @return nonzero on match, zero otherwise
+ */
+#define MHD_thread_ID_match_current_(ID) (GetCurrentThreadId() == (ID))
+#endif
+
 /**
  * Signature of main function for a thread.
  *

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]