summary refs log tree commit diff
path: root/nptl/allocatestack.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2006-02-13 01:27:41 +0000
committerUlrich Drepper <drepper@redhat.com>2006-02-13 01:27:41 +0000
commitb007ce7cc6971e4bd4cd91c558efd3d4603d941d (patch)
treeb8c327bb42fea490cfa5ea910fbab4ca73a404aa /nptl/allocatestack.c
parentbbf209a4272252276215e2606746eb2d3c7a326e (diff)
downloadglibc-b007ce7cc6971e4bd4cd91c558efd3d4603d941d.tar.gz
glibc-b007ce7cc6971e4bd4cd91c558efd3d4603d941d.tar.xz
glibc-b007ce7cc6971e4bd4cd91c558efd3d4603d941d.zip
* allocatestack.c (allocate_stack): Initialize robust_list. cvs/fedora-glibc-20060213T0650
	* 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.
Diffstat (limited to 'nptl/allocatestack.c')
-rw-r--r--nptl/allocatestack.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index e6bcc2170f..046a2470fc 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005
-   Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -366,6 +365,12 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
       /* The process ID is also the same as that of the caller.  */
       pd->pid = THREAD_GETMEM (THREAD_SELF, pid);
 
+      /* List of robust mutexes.  */
+#ifdef __PTHREAD_MUTEX_HAVE_PREV
+      pd->robust_list.__prev = &pd->robust_list;
+#endif
+      pd->robust_list.__next = &pd->robust_list;
+
       /* Allocate the DTV for this thread.  */
       if (_dl_allocate_tls (TLS_TPADJ (pd)) == NULL)
 	{
@@ -500,6 +505,12 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
 	  /* The process ID is also the same as that of the caller.  */
 	  pd->pid = THREAD_GETMEM (THREAD_SELF, pid);
 
+	  /* List of robust mutexes.  */
+#ifdef __PTHREAD_MUTEX_HAVE_PREV
+	  pd->robust_list.__prev = &pd->robust_list;
+#endif
+	  pd->robust_list.__next = &pd->robust_list;
+
 	  /* Allocate the DTV for this thread.  */
 	  if (_dl_allocate_tls (TLS_TPADJ (pd)) == NULL)
 	    {