summaryrefslogtreecommitdiffstats
path: root/lib/qpthreads.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/qpthreads.h')
-rw-r--r--lib/qpthreads.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/qpthreads.h b/lib/qpthreads.h
index 49a7c1e3..361271ff 100644
--- a/lib/qpthreads.h
+++ b/lib/qpthreads.h
@@ -137,13 +137,21 @@ qpt_freeze_qpthreads_enabled(void) ; /* get and freeze qpthreads_enabled */
/*==============================================================================
* Thread self knowledge -- returns 'NULL' if !qpthreads_enabled
*/
-
Inline qpt_thread_t qpt_thread_self(void)
{
return qpthreads_enabled ? pthread_self() : (qpt_thread_t)NULL;
} ;
/*==============================================================================
+ * Thread equality -- returns non-zero (true) if threads are *equal*
+ * -- all threads are equal if !qpthreads_enabled
+ */
+Inline int qpt_threads_equal(qpt_thread_t a, qpt_thread_t b)
+{
+ return !qpthreads_enabled || pthread_equal(a, b) ? 1 : 0 ;
+} ;
+
+/*==============================================================================
* Mutex handling.
*
* Quagga's default mutex type is: