From e41a8e264e177d9314847ac6dea653be061a376b Mon Sep 17 00:00:00 2001 From: "Chris Hall (GMCH)" Date: Mon, 7 Dec 2009 11:46:57 +0000 Subject: Enabled qpt_mutex_recursive in lib/qpthreads. This allows mutexes to be initialised as recursive. Required correctly placed setting of _GNU_SOURCE (for gcc). It is assumed that "config.h" will enable the required pthreads features -- which are now documented in lib/qpthread.c. --- lib/qpthreads.h | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'lib/qpthreads.h') diff --git a/lib/qpthreads.h b/lib/qpthreads.h index 8da7f3a6..65e64dbf 100644 --- a/lib/qpthreads.h +++ b/lib/qpthreads.h @@ -31,7 +31,6 @@ #include "zassert.h" #include "qtime.h" - #ifndef Inline #define Inline static inline #endif @@ -57,22 +56,6 @@ #error Require _POSIX_THREADS #endif -/*============================================================================== - * TEMPORARY WORKAROUND - * - * TODO: discover why PTHREAD_MUTEX_NORMAL etc are not defined !! - * - */ - -#define PTHREAD_MUTEXATTR_SETTYPE_MISSING 1 - -#ifdef PTHREAD_MUTEXATTR_SETTYPE_MISSING -#define PTHREAD_MUTEX_NORMAL PTHREAD_MUTEX_TIMED_NP -#define PTHREAD_MUTEX_ERRORCHECK PTHREAD_MUTEX_ERRORCHECK_NP -#define PTHREAD_MUTEX_RECURSIVE PTHREAD_MUTEX_RECURSIVE_NP -#define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL -#endif - /*============================================================================== * Data types */ @@ -143,6 +126,8 @@ Inline qpt_thread_t qpt_thread_self(void) * * If _DEFAULT is faster than _NORMAL, then QPT_MUTEX_TYPE_DEFAULT may be * used to override this choice. + * + * NB: do not (currently) support pthread_mutex_timedlock(). */ enum qpt_mutex_options -- cgit v1.2.3