summaryrefslogtreecommitdiff
path: root/nptl/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r--nptl/sysdeps/pthread/pthread.h53
-rw-r--r--nptl/sysdeps/pthread/sigaction.c8
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h8
-rw-r--r--nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/register-atfork.c4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/unregister-atfork.c4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h15
8 files changed, 74 insertions, 26 deletions
diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h
index badadae169..5413661eb3 100644
--- a/nptl/sysdeps/pthread/pthread.h
+++ b/nptl/sysdeps/pthread/pthread.h
@@ -60,24 +60,39 @@ enum
#endif
};
-/* Mutex initializers. */
-#define PTHREAD_MUTEX_INITIALIZER \
- { { 0, 0, 0, 0, 0, 0 } }
+
#ifdef __USE_GNU
-# if __WORDSIZE == 64
+/* Robust mutex or not flags. */
+enum
+{
+ PTHREAD_MUTEX_STALLED_NP,
+ PTHREAD_MUTEX_ROBUST_NP
+};
+#endif
+
+
+/* Mutex initializers. */
+#if __WORDSIZE == 64
+# define PTHREAD_MUTEX_INITIALIZER \
+ { { 0, 0, 0, 0, 0, 0, (void *) 0, (void *) 0 } }
+# ifdef __USE_GNU
# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0 } }
+ { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, (void *) 0, (void *) 0 } }
# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0 } }
+ { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, (void *) 0, (void *) 0 } }
# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0 } }
-# else
+ { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, (void *) 0, (void *) 0 } }
+# endif
+#else
+# define PTHREAD_MUTEX_INITIALIZER \
+ { { 0, 0, 0, 0, 0, { 0 } } }
+# ifdef __USE_GNU
# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, 0 } }
+ { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { 0 } } }
# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, 0 } }
+ { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, { 0 } } }
# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
- { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, 0 } }
+ { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, { 0 } } }
# endif
#endif
@@ -696,6 +711,12 @@ extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) __THROW;
+#ifdef __USE_GNU
+/* Declare the state protected by MUTEX as consistent. */
+extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex) __THROW;
+#endif
+
+
/* Functions for handling mutex attributes. */
/* Initialize mutex attribute object ATTR with default attributes
@@ -726,6 +747,16 @@ extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
__THROW;
#endif
+#ifdef __USE_GNU
+/* Get the robustness flag of the mutex attribute ATTR. */
+extern int pthread_mutexattr_getrobust_np (__const pthread_mutexattr_t *__attr,
+ int *__robustness) __THROW;
+
+/* Set the robustness flag of the mutex attribute ATTR. */
+extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr,
+ int __robustness) __THROW;
+#endif
+
#if defined __USE_UNIX98 || defined __USE_XOPEN2K
/* Functions for handling read-write locks. */
diff --git a/nptl/sysdeps/pthread/sigaction.c b/nptl/sysdeps/pthread/sigaction.c
index 4d36150a90..445a2cb36f 100644
--- a/nptl/sysdeps/pthread/sigaction.c
+++ b/nptl/sysdeps/pthread/sigaction.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -28,7 +28,11 @@
SIGCANCEL or SIGTIMER to be handled. */
# define LIBC_SIGACTION 1
-# include <nptl/sysdeps/pthread/sigaction.c>
+/* Note this include must be one that isn't found using a -I directory such
+ as -I. or -I.. for using an explicit <sysdeps/...> path, because that
+ would reset the search path starting position for the #include_next
+ below, to after that -I directory, and skip the search we want to do. */
+# include "sigaction.c"
int
__sigaction (sig, act, oact)
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
index ddb3574aaa..3bd1019995 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
+++ b/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
@@ -45,7 +45,7 @@ typedef union
/* Data structures for mutex handling. The structure of the attribute
type is not exposed on purpose. */
-typedef union
+typedef union __pthread_mutex_u
{
struct
{
@@ -56,7 +56,11 @@ typedef union
binary compatibility. */
int __kind;
unsigned int __nusers;
- int __spins;
+ union
+ {
+ int __spins;
+ union __pthread_mutex_u *__next;
+ };
} __data;
char __size[__SIZEOF_PTHREAD_MUTEX_T];
long int __align;
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
index 1605b69b69..3e908aef9c 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
@@ -57,7 +57,7 @@ __new_sem_wait:
cfi_offset(6, -12) /* %esi */
3: movl (%ebx), %eax
2: testl %eax, %eax
- je,pn 1f
+ je 1f
leal -1(%eax), %edx
LOCK
@@ -73,7 +73,7 @@ __new_sem_wait:
cfi_adjust_cfa_offset(-12)
ret
- cfi_adjust_cfa_offset(8)
+ cfi_adjust_cfa_offset(12)
cfi_offset(3, -8) /* %ebx */
cfi_offset(6, -12) /* %esi */
1: call __pthread_enable_asynccancel
diff --git a/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c b/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
index 3d1c021819..4e60596f7d 100644
--- a/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
+++ b/nptl/sysdeps/unix/sysv/linux/libc_pthread_init.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -19,7 +19,7 @@
#include <unistd.h>
#include <list.h>
-#include "fork.h"
+#include <fork.h>
#include <dl-sysdep.h>
#include <tls.h>
#include <string.h>
diff --git a/nptl/sysdeps/unix/sysv/linux/register-atfork.c b/nptl/sysdeps/unix/sysv/linux/register-atfork.c
index 9707e4663c..cb5b2b832f 100644
--- a/nptl/sysdeps/unix/sysv/linux/register-atfork.c
+++ b/nptl/sysdeps/unix/sysv/linux/register-atfork.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -20,7 +20,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
-#include "fork.h"
+#include <fork.h>
/* Lock to protect allocation and deallocation of fork handlers. */
diff --git a/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c b/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c
index 72c8d615eb..964f5b7094 100644
--- a/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c
+++ b/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -19,7 +19,7 @@
#include <errno.h>
#include <stdlib.h>
-#include "fork.h"
+#include <fork.h>
#include <atomic.h>
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
index 7f1ace693c..3eb33a8646 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
@@ -59,7 +59,7 @@ typedef union
/* Data structures for mutex handling. The structure of the attribute
type is not exposed on purpose. */
-typedef union
+typedef union __pthread_mutex_u
{
struct
{
@@ -72,10 +72,19 @@ typedef union
/* KIND must stay at this position in the structure to maintain
binary compatibility. */
int __kind;
-#if __WORDSIZE != 64
+#if __WORDSIZE == 64
+ int __spins;
+ union __pthread_mutex_u *__next;
+ union __pthread_mutex_u *__prev;
+# define __PTHREAD_MUTEX_HAVE_PREV 1
+#else
unsigned int __nusers;
+ union
+ {
+ int __spins;
+ union __pthread_mutex_u *__next;
+ };
#endif
- int __spins;
} __data;
char __size[__SIZEOF_PTHREAD_MUTEX_T];
long int __align;