From b4ad7b01a567c09825834415e41a876ea737f2d5 Mon Sep 17 00:00:00 2001 From: ad Date: Thu, 5 Jun 2008 21:40:17 +0000 Subject: [PATCH] glibc compatibile PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP, requested by rafal@. --- lib/libpthread/pthread.h | 5 ++++- lib/libpthread/pthread_types.h | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/libpthread/pthread.h b/lib/libpthread/pthread.h index 52275d527178..1d69a98f02c1 100644 --- a/lib/libpthread/pthread.h +++ b/lib/libpthread/pthread.h @@ -1,4 +1,4 @@ -/* $NetBSD: pthread.h,v 1.29 2008/04/28 20:23:01 martin Exp $ */ +/* $NetBSD: pthread.h,v 1.30 2008/06/05 21:40:17 ad Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -245,6 +245,9 @@ __END_DECLS #define PTHREAD_RWLOCK_INITIALIZER _PTHREAD_RWLOCK_INITIALIZER #define PTHREAD_SPINLOCK_INITIALIZER _PTHREAD_SPINLOCK_INITIALIZER +#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ + _PTHREAD_MUTEX_RECURSIVE_INITIALIZER_NP + /* * Use macros to rename many pthread functions to the corresponding * libc symbols which are either trivial/no-op stubs or the real diff --git a/lib/libpthread/pthread_types.h b/lib/libpthread/pthread_types.h index 684e8b550399..0e9ee8ad9849 100644 --- a/lib/libpthread/pthread_types.h +++ b/lib/libpthread/pthread_types.h @@ -1,4 +1,4 @@ -/* $NetBSD: pthread_types.h,v 1.10 2008/04/28 20:23:02 martin Exp $ */ +/* $NetBSD: pthread_types.h,v 1.11 2008/06/05 21:40:17 ad Exp $ */ /*- * Copyright (c) 2001, 2008 The NetBSD Foundation, Inc. @@ -98,7 +98,10 @@ struct __pthread_mutex_st { #define _PT_MUTEX_MAGIC 0x33330003 #define _PT_MUTEX_DEAD 0xDEAD0003 -#define _PTHREAD_MUTEX_INITIALIZER { _PT_MUTEX_MAGIC, 0, 0, NULL, NULL } +#define _PTHREAD_MUTEX_INITIALIZER \ + { _PT_MUTEX_MAGIC, 0, 0, NULL, NULL } +#define _PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \ + { _PT_MUTEX_MAGIC, 0, 0, NULL, (void *)2L } struct __pthread_mutexattr_st { unsigned int ptma_magic;