From b007ce7cc6971e4bd4cd91c558efd3d4603d941d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 13 Feb 2006 01:27:41 +0000 Subject: * allocatestack.c (allocate_stack): Initialize robust_list. * init.c (__pthread_initialize_minimal_internal): Likewise. * descr.h (struct xid_command): Pretty printing. (struct pthread): Use __pthread_list_t or __pthread_slist_t for robust_list. Adjust macros. * pthread_create.c (start_thread): Adjust robust_list handling. * phtread_mutex_unlock.c: Don't allow unlocking from any thread but the owner for all robust mutex types. * sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Define __pthread_list_t and __pthread_slist_t. Use them in pthread_mutex_t. * sysdeps/pthread/pthread.h: Adjust mutex initializers. --- nptl/pthread_mutex_unlock.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'nptl/pthread_mutex_unlock.c') diff --git a/nptl/pthread_mutex_unlock.c b/nptl/pthread_mutex_unlock.c index babce51a6f..4d87381065 100644 --- a/nptl/pthread_mutex_unlock.c +++ b/nptl/pthread_mutex_unlock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2002. @@ -76,15 +76,12 @@ __pthread_mutex_unlock_usercnt (mutex, decr) goto robust; case PTHREAD_MUTEX_ROBUST_PRIVATE_ERRORCHECK_NP: - /* Error checking mutex. */ + case PTHREAD_MUTEX_ROBUST_PRIVATE_NP: + case PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP: if (abs (mutex->__data.__owner) != THREAD_GETMEM (THREAD_SELF, tid) || ! lll_mutex_islocked (mutex->__data.__lock)) return EPERM; - /* FALLTHROUGH */ - - case PTHREAD_MUTEX_ROBUST_PRIVATE_NP: - case PTHREAD_MUTEX_ROBUST_PRIVATE_ADAPTIVE_NP: /* If the previous owner died and the caller did not succeed in making the state consistent, mark the mutex as unrecoverable and make all waiters. */ -- cgit v1.2.1