]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nptl: Move nptl-specific types to separate header
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 13 Jan 2020 21:15:46 +0000 (21:15 +0000)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Sun, 9 Feb 2020 12:56:48 +0000 (13:56 +0100)
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
nptl/call_once.c
sysdeps/nptl/bits/thread-shared-types.h
sysdeps/nptl/threads.h

index 3f880a90731df4bb4b4641d0420ae727f7072d64..25e2964c7672621cee3210ea2548b6880fe25780 100644 (file)
@@ -27,5 +27,5 @@ call_once (once_flag *flag, void (*func)(void))
                  "sizeof (once_flag) != sizeof (pthread_once_t)");
   _Static_assert (alignof (once_flag) == alignof (pthread_once_t),
                  "alignof (once_flag) != alignof (pthread_once_t)");
-  __pthread_once (&flag->__data, func);
+  __pthread_once ((pthread_once_t *) flag, func);
 }
index fd08b6916a057078ef1469a973b52f7796152d19..fbbdd0bb3605134f03fda2c9b7835e957f44dd49 100644 (file)
@@ -116,4 +116,14 @@ struct __pthread_cond_s
   unsigned int __g_signals[2];
 };
 
+typedef unsigned int __tss_t;
+typedef unsigned long int __thrd_t;
+
+typedef struct
+{
+  int __data __ONCE_ALIGNMENT;
+} __once_flag;
+
+#define __ONCE_FLAG_INIT { 0 }
+
 #endif /* _THREAD_SHARED_TYPES_H  */
index 6d5e4bfe02453a3bda7bb24ebd154b6da2ebd6b5..0ac489b4a12ee3589bdb472d4f1db5a0bb487b1f 100644 (file)
@@ -24,7 +24,7 @@
 
 __BEGIN_DECLS
 
-#include <bits/pthreadtypes-arch.h>
+#include <bits/thread-shared-types.h>
 #include <bits/types/struct_timespec.h>
 
 #ifndef __cplusplus
@@ -32,10 +32,10 @@ __BEGIN_DECLS
 #endif
 
 #define TSS_DTOR_ITERATIONS 4
-typedef unsigned int tss_t;
+typedef __tss_t tss_t;
 typedef void (*tss_dtor_t) (void*);
 
-typedef unsigned long int thrd_t;
+typedef __thrd_t thrd_t;
 typedef int (*thrd_start_t) (void*);
 
 /* Exit and error codes.  */
@@ -56,11 +56,8 @@ enum
   mtx_timed     = 2
 };
 
-typedef struct
-{
-  int __data __ONCE_ALIGNMENT;
-} once_flag;
-#define ONCE_FLAG_INIT { 0 }
+typedef __once_flag once_flag;
+#define ONCE_FLAG_INIT __ONCE_FLAG_INIT
 
 typedef union
 {