From 20b6b088dd8864472dc03b1aaabfbb33d9b7ad47 Mon Sep 17 00:00:00 2001 From: "Chris Hall (GMCH)" Date: Sun, 6 Dec 2009 23:25:39 +0000 Subject: Updates to lib/qpthreads.c & .h Added qpt_thread_self(). Initialised output sigset_t before setting it in qpt_thread_sigmask(). --- lib/qpthreads.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'lib/qpthreads.h') diff --git a/lib/qpthreads.h b/lib/qpthreads.h index d84b2c5c..8da7f3a6 100644 --- a/lib/qpthreads.h +++ b/lib/qpthreads.h @@ -87,7 +87,8 @@ typedef pthread_attr_t qpt_thread_attr_t ; * Thread Creation -- see qpthreads.c for further discussion. */ -enum qpt_attr_options { +enum qpt_attr_options +{ qpt_attr_joinable = 0, /* the default for Quagga */ qpt_attr_detached = 0x0001, /* otherwise will set joinable */ @@ -114,6 +115,15 @@ qpt_thread_attr_init(qpt_thread_attr_t* attr, enum qpt_attr_options opts, extern qpt_thread_t qpt_thread_create(void* (*start)(void*), void* arg, qpt_thread_attr_t* attr) ; +/*============================================================================== + * Thread self knowledge. + */ + +Inline qpt_thread_t qpt_thread_self(void) +{ + return pthread_self() ; +} ; + /*============================================================================== * Mutex handling. * @@ -135,7 +145,8 @@ qpt_thread_create(void* (*start)(void*), void* arg, qpt_thread_attr_t* attr) ; * used to override this choice. */ -enum qpt_mutex_options { +enum qpt_mutex_options +{ qpt_mutex_quagga = 0x0000, /* Quagga's default */ qpt_mutex_normal = 0x0001, qpt_mutex_recursive = 0x0002, @@ -202,7 +213,8 @@ qpt_mutex_unlock(qpt_mutex_t* mx) ; /* do nothing if mx == NULL */ # endif #endif -enum qpt_cond_options { +enum qpt_cond_options +{ qpt_cond_quagga = 0x0000, /* Quagga's default */ qpt_cond_realtime = 0x0001, /* standard default */ qpt_cond_monotonic = 0x0002, -- cgit v1.2.3