svn commit: branches/uClibc-nptl/libpthread/nptl/sysdeps: pthread unix/sysv/linux/alpha/bits unix/ etc...

kraj at uclibc.org kraj at uclibc.org
Wed Dec 10 04:39:45 UTC 2008


Author: kraj
Date: 2008-12-09 20:39:44 -0800 (Tue, 09 Dec 2008)
New Revision: 24351

Log:
Signed-off-by: Khem Raj <raj.khem at gmail.com>
Update pthread_mutex_t definition and initializations.


Modified:
   branches/uClibc-nptl/libpthread/nptl/sysdeps/pthread/pthread.h
   branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
   branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
   branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
   branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
   branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
   branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h


Changeset:
Modified: branches/uClibc-nptl/libpthread/nptl/sysdeps/pthread/pthread.h
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sysdeps/pthread/pthread.h	2008-12-10 00:29:29 UTC (rev 24350)
+++ branches/uClibc-nptl/libpthread/nptl/sysdeps/pthread/pthread.h	2008-12-10 04:39:44 UTC (rev 24351)
@@ -64,17 +64,21 @@
 };
 
 /* Mutex initializers.  */
-#define PTHREAD_MUTEX_INITIALIZER \
-  { { 0, 0, 0, 0, 0, { 0 } } }
-#ifdef __USE_GNU
-# if __WORDSIZE == 64
+#if __WORDSIZE == 64
+# define PTHREAD_MUTEX_INITIALIZER \
+  { { 0, 0, 0, 0, 0, 0, { 0, 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, { 0, 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, { 0, 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, { 0, 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 } } }
 #  define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
@@ -84,7 +88,6 @@
 # endif
 #endif
 
-
 /* Read-write lock types.  */
 #if defined __USE_UNIX98 || defined __USE_XOPEN2K
 enum

Modified: branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h	2008-12-10 00:29:29 UTC (rev 24350)
+++ branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/alpha/bits/pthreadtypes.h	2008-12-10 04:39:44 UTC (rev 24351)
@@ -43,11 +43,18 @@
 } pthread_attr_t;
 
 
+typedef struct __pthread_internal_list
+{
+  struct __pthread_internal_list *__prev;
+  struct __pthread_internal_list *__next;
+} __pthread_list_t;
+
+
 /* Data structures for mutex handling.  The structure of the attribute
    type is deliberately not exposed.  */
 typedef union
 {
-  struct
+  struct __pthread_mutex_s
   {
     int __lock;
     unsigned int __count;
@@ -57,6 +64,8 @@
        binary compatibility.  */
     int __kind;
     int __spins;
+    __pthread_list_t __list;
+#define __PTHREAD_MUTEX_HAVE_PREV       1
   } __data;
   char __size[__SIZEOF_PTHREAD_MUTEX_T];
   long int __align;

Modified: branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h	2008-12-10 00:29:29 UTC (rev 24350)
+++ branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h	2008-12-10 04:39:44 UTC (rev 24351)
@@ -43,11 +43,17 @@
 } pthread_attr_t;
 
 
+typedef struct __pthread_internal_slist
+{
+  struct __pthread_internal_slist *__next;
+} __pthread_slist_t;
+
+
 /* Data structures for mutex handling.  The structure of the attribute
    type is not exposed on purpose.  */
 typedef union
 {
-  struct
+  struct __pthread_mutex_s
   {
     int __lock;
     unsigned int __count;
@@ -56,7 +62,11 @@
        binary compatibility.  */
     int __kind;
     unsigned int __nusers;
-    int __spins;
+    __extension__ union
+    {
+      int __spins;
+      __pthread_slist_t __list;
+    };
   } __data;
   char __size[__SIZEOF_PTHREAD_MUTEX_T];
   long int __align;

Modified: branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h	2008-12-10 00:29:29 UTC (rev 24350)
+++ branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/mips/bits/pthreadtypes.h	2008-12-10 04:39:44 UTC (rev 24351)
@@ -54,12 +54,24 @@
   long int __align;
 } pthread_attr_t;
 
+#if _MIPS_SIM == _ABI64
+typedef struct __pthread_internal_list
+{
+  struct __pthread_internal_list *__prev;
+  struct __pthread_internal_list *__next;
+} __pthread_list_t;
+#else
+typedef struct __pthread_internal_slist
+{
+  struct __pthread_internal_slist *__next;
+} __pthread_slist_t;
+#endif
 
 /* Data structures for mutex handling.  The structure of the attribute
    type is deliberately not exposed.  */
 typedef union
 {
-  struct
+  struct __pthread_mutex_s
   {
     int __lock;
     unsigned int __count;
@@ -70,10 +82,18 @@
     /* KIND must stay at this position in the structure to maintain
        binary compatibility.  */
     int __kind;
-#if _MIPS_SIM != _ABI64
+#if _MIPS_SIM == _ABI64
+    int __spins;
+    __pthread_list_t __list;
+# define __PTHREAD_MUTEX_HAVE_PREV      1
+#else
     unsigned int __nusers;
+    __extension__ union
+    {
+      int __spins;
+      __pthread_slist_t __list;
+    };
 #endif
-    int __spins;
   } __data;
   char __size[__SIZEOF_PTHREAD_MUTEX_T];
   long int __align;

Modified: branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h	2008-12-10 00:29:29 UTC (rev 24350)
+++ branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h	2008-12-10 04:39:44 UTC (rev 24351)
@@ -57,12 +57,24 @@
   long int __align;
 } pthread_attr_t;
 
+#if __WORDSIZE == 64
+typedef struct __pthread_internal_list
+{
+  struct __pthread_internal_list *__prev;
+  struct __pthread_internal_list *__next;
+} __pthread_list_t;
+#else
+typedef struct __pthread_internal_slist
+{
+  struct __pthread_internal_slist *__next;
+} __pthread_slist_t;
+#endif
 
 /* Data structures for mutex handling.  The structure of the attribute
    type is deliberately not exposed.  */
 typedef union
 {
-  struct
+  struct __pthread_mutex_s
   {
     int __lock;
     unsigned int __count;
@@ -73,10 +85,18 @@
     /* KIND must stay at this position in the structure to maintain
        binary compatibility.  */
     int __kind;
-#if __WORDSIZE != 64
+#if __WORDSIZE == 64
+    int __spins;
+    __pthread_list_t __list;
+# define __PTHREAD_MUTEX_HAVE_PREV      1
+#else
     unsigned int __nusers;
+    __extension__ union
+    {
+      int __spins;
+      __pthread_slist_t __list;
+    };
 #endif
-    int __spins;
   } __data;
   char __size[__SIZEOF_PTHREAD_MUTEX_T];
   long int __align;

Modified: branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h	2008-12-10 00:29:29 UTC (rev 24350)
+++ branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h	2008-12-10 04:39:44 UTC (rev 24351)
@@ -58,11 +58,25 @@
 } pthread_attr_t;
 
 
+#if __WORDSIZE == 64
+typedef struct __pthread_internal_list
+{
+  struct __pthread_internal_list *__prev;
+  struct __pthread_internal_list *__next;
+} __pthread_list_t;
+#else
+typedef struct __pthread_internal_slist
+{
+  struct __pthread_internal_slist *__next;
+} __pthread_slist_t;
+#endif
+
+
 /* Data structures for mutex handling.  The structure of the attribute
    type is deliberately not exposed.  */
 typedef union
 {
-  struct
+  struct __pthread_mutex_s
   {
     int __lock;
     unsigned int __count;
@@ -73,10 +87,18 @@
     /* KIND must stay at this position in the structure to maintain
        binary compatibility.  */
     int __kind;
-#if __WORDSIZE != 64
+#if __WORDSIZE == 64
+    int __spins;
+    __pthread_list_t __list;
+# define __PTHREAD_MUTEX_HAVE_PREV      1
+#else
     unsigned int __nusers;
+    __extension__ union
+    {
+      int __spins;
+      __pthread_slist_t __list;
+    };
 #endif
-    int __spins;
   } __data;
   char __size[__SIZEOF_PTHREAD_MUTEX_T];
   long int __align;

Modified: branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h
===================================================================
--- branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h	2008-12-10 00:29:29 UTC (rev 24350)
+++ branches/uClibc-nptl/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h	2008-12-10 04:39:44 UTC (rev 24351)
@@ -57,6 +57,20 @@
 } pthread_attr_t;
 
 
+#if __WORDSIZE == 64
+typedef struct __pthread_internal_list
+{
+  struct __pthread_internal_list *__prev;
+  struct __pthread_internal_list *__next;
+} __pthread_list_t;
+#else
+typedef struct __pthread_internal_slist
+{
+  struct __pthread_internal_slist *__next;
+} __pthread_slist_t;
+#endif
+
+
 /* Data structures for mutex handling.  The structure of the attribute
    type is not exposed on purpose.  */
 typedef union




More information about the uClibc-cvs mailing list