This is the mail archive of the
cygwin-patches@cygwin.com
mailing list for the Cygwin project.
[patch] Symbolic value for PTHREAD_MUTEX_DEFAULT
- From: Christophe Galerne <christophegalerne at earthlink dot net>
- To: cygwin <cygwin at cygwin dot com>, cygwin-patches at cygwin dot com
- Date: Fri, 06 Dec 2002 15:40:48 -0800
- Subject: [patch] Symbolic value for PTHREAD_MUTEX_DEFAULT
Hi,
As discussed with Robert Collins, I propose this patch to make
the 'default' mutex type more explicit.
2002-12-05 Christophe Galerne <christophegalerne@earthlink.net>
* pthread.h (PTHREAD_MUTEX_DEFAULT):
reorder PTHREAD_MUTEX_DEFAULT and PTHREAD_MUTEX_RECURSIVE so that
PTHREAD_MUTEX_DEFAULT can be defined as PTHREAD_MUTEX_RECURSIVE.
add a comment that PTHREAD_MUTEX_NORMAL is not yet implemented.
? pthread_constant.patch
Index: pthread.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/pthread.h,v
retrieving revision 1.12
diff -u -p -r1.12 pthread.h
--- pthread.h 4 Jul 2002 14:17:30 -0000 1.12
+++ pthread.h 6 Dec 2002 22:55:18 -0000
@@ -50,12 +50,15 @@ extern "C"
#define PTHREAD_CREATE_JOINABLE 0
#define PTHREAD_EXPLICIT_SCHED 1
#define PTHREAD_INHERIT_SCHED 0
-#define PTHREAD_MUTEX_DEFAULT 0
+
+#define PTHREAD_MUTEX_RECURSIVE 0
#define PTHREAD_MUTEX_ERRORCHECK 1
+/* not implemented yet */
#define PTHREAD_MUTEX_NORMAL 2
+#define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_RECURSIVE
+
/* this should be too low to ever be a valid address */
#define PTHREAD_MUTEX_INITIALIZER (void *)20
-#define PTHREAD_MUTEX_RECURSIVE 0
#define PTHREAD_ONCE_INIT { PTHREAD_MUTEX_INITIALIZER, 0 }
#define PTHREAD_PRIO_INHERIT
#define PTHREAD_PRIO_NONE
@@ -103,7 +106,7 @@ void pthread_cleanup_push (void (*routin
void pthread_cleanup_pop (int execute);
*/
typedef void (*__cleanup_routine_type) (void *);
-typedef struct _pthread_cleanup_handler
+typedef struct _pthread_cleanup_handler
{
__cleanup_routine_type function;
void *arg;