linamh/sys-libs/glibc/files/2.3.4/glibc-2.3.4-nptl-pthread.h-g++-fix.patch
2009-09-12 08:46:08 +00:00

97 lines
3.2 KiB
Diff

--- glibc-2.3.3.old/nptl/sysdeps/pthread/pthread.h 2004-09-21 19:52:49.003553536 +0000
+++ glibc-2.3.3/nptl/sysdeps/pthread/pthread.h 2004-09-21 19:55:01.582398488 +0000
@@ -27,6 +27,7 @@
#include <signal.h>
#include <bits/pthreadtypes.h>
#include <bits/setjmp.h>
+#include <bits/wordsize.h>
/* Detach state. */
@@ -63,17 +64,26 @@
#define PTHREAD_MUTEX_INITIALIZER \
{ }
#ifdef __USE_GNU
-# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
- { .__data = { .__kind = PTHREAD_MUTEX_RECURSIVE_NP } }
-# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
- { .__data = { .__kind = PTHREAD_MUTEX_ERRORCHECK_NP } }
-# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
- { .__data = { .__kind = PTHREAD_MUTEX_ADAPTIVE_NP } }
+# if __WORDSIZE == 64
+# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
+ { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } }
+# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
+ { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } }
+# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
+ { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } }
+# else
+# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
+ { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } }
+# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
+ { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } }
+# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
+ { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } }
+# endif
#endif
/* Read-write lock types. */
-#ifdef __USE_UNIX98
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
enum
{
PTHREAD_RWLOCK_PREFER_READER_NP,
@@ -81,15 +91,21 @@
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
};
-#endif /* Unix98 */
/* Read-write lock initializers. */
-#define PTHREAD_RWLOCK_INITIALIZER \
+# define PTHREAD_RWLOCK_INITIALIZER \
{ }
-#ifdef __USE_GNU
-# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
- { .__data = { .__flags = PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
-#endif
+# ifdef __USE_GNU
+# if __WORDSIZE == 64
+# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
+ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
+ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
+# else
+# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
+ { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
+# endif
+# endif
+#endif /* Unix98 or XOpen2K */
/* Scheduler inheritance. */
@@ -390,9 +406,12 @@
/* Guarantee that the initialization function INIT_ROUTINE will be called
only once, even if pthread_once is executed several times with the
same ONCE_CONTROL argument. ONCE_CONTROL must point to a static or
- extern variable initialized to PTHREAD_ONCE_INIT. */
+ extern variable initialized to PTHREAD_ONCE_INIT.
+
+ The initialization functions might throw exception which is why
+ this function is not marked with __THROW. */
extern int pthread_once (pthread_once_t *__once_control,
- void (*__init_routine) (void)) __THROW;
+ void (*__init_routine) (void));
/* Functions for handling cancellation.
@@ -699,7 +718,7 @@
#endif
-#ifdef __USE_UNIX98
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K
/* Functions for handling read-write locks. */
/* Initialize read-write lock RWLOCK using attributes ATTR, or use