From patchwork Tue Jan 14 18:52:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 37376 Received: (qmail 93728 invoked by alias); 14 Jan 2020 18:53:30 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 93477 invoked by uid 89); 14 Jan 2020 18:53:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Samuel Thibault Subject: [PATCH 05/10] nptl: Move nptl-specific types to separate header Date: Tue, 14 Jan 2020 19:52:50 +0100 Message-Id: <20200114185255.25813-7-samuel.thibault@ens-lyon.org> In-Reply-To: <20200114185255.25813-1-samuel.thibault@ens-lyon.org> References: <20200114185255.25813-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 --- nptl/call_once.c | 2 +- sysdeps/nptl/bits/thread-shared-types.h | 10 ++++++++++ sysdeps/nptl/threads.h | 13 +++++-------- 3 files changed, 16 insertions(+), 9 deletions(-) Reviewed-by: Adhemerval Zanella diff --git a/nptl/call_once.c b/nptl/call_once.c index 3f880a9073..25e2964c76 100644 --- a/nptl/call_once.c +++ b/nptl/call_once.c @@ -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); } diff --git a/sysdeps/nptl/bits/thread-shared-types.h b/sysdeps/nptl/bits/thread-shared-types.h index fd08b6916a..fbbdd0bb36 100644 --- a/sysdeps/nptl/bits/thread-shared-types.h +++ b/sysdeps/nptl/bits/thread-shared-types.h @@ -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 */ diff --git a/sysdeps/nptl/threads.h b/sysdeps/nptl/threads.h index 6d5e4bfe02..0ac489b4a1 100644 --- a/sysdeps/nptl/threads.h +++ b/sysdeps/nptl/threads.h @@ -24,7 +24,7 @@ __BEGIN_DECLS -#include +#include #include #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 {