diff options
author | Kurt Miller <kurt@cvs.openbsd.org> | 2012-04-13 13:50:38 +0000 |
---|---|---|
committer | Kurt Miller <kurt@cvs.openbsd.org> | 2012-04-13 13:50:38 +0000 |
commit | e0f09140df4d1589ba0508b4df463185b68f2d1d (patch) | |
tree | bc30fdb57475affc289b31ee2310a992f163dcf0 /lib/librthread/rthread_mutexattr.c | |
parent | 28e13e25d7be4da391c39ddc355060d5c010dcf0 (diff) |
Use PTHREAD_MUTEX_DEFAULT in static init and mutexattr_init. If the
default mutex type changes to NORMAL, when there is an uninitialized
mutex provided to unlock, allow it to succeed similar to an unlocked
mutex. For other cases abort instead of segfault. okay guenther@
Diffstat (limited to 'lib/librthread/rthread_mutexattr.c')
-rw-r--r-- | lib/librthread/rthread_mutexattr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/librthread/rthread_mutexattr.c b/lib/librthread/rthread_mutexattr.c index d737ea1adf0..7565b4f77a6 100644 --- a/lib/librthread/rthread_mutexattr.c +++ b/lib/librthread/rthread_mutexattr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rthread_mutexattr.c,v 1.2 2012/02/15 04:58:42 guenther Exp $ */ +/* $OpenBSD: rthread_mutexattr.c,v 1.3 2012/04/13 13:50:37 kurt Exp $ */ /* * Copyright (c) 2004,2005 Ted Unangst <tedu@openbsd.org> * Copyright (c) 2011 Philip Guenther <guenther@openbsd.org> @@ -38,7 +38,7 @@ pthread_mutexattr_init(pthread_mutexattr_t *attrp) attr = calloc(1, sizeof(*attr)); if (!attr) return (errno); - attr->ma_type = PTHREAD_MUTEX_ERRORCHECK; + attr->ma_type = PTHREAD_MUTEX_DEFAULT; *attrp = attr; return (0); |