From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 1E7201F466 for ; Tue, 14 Jan 2020 18:54:14 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; q=dns; s= default; b=jkY5pfyJZaxf9hJuU/CmcGcMIWBaKEjsQdjEHKr25k23uuVOur7Ry cNaQo9BN0b5Dim8CyN2CiHpBlaE8ucme6QFl0340m3h7Isq+of8t4MzSaPW3rz5Q l5LCLiH3eTcPwobZ5tsMablPbHtQ/HGmjMLzX5xrkUPVuzXp59jpL8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; s=default; bh=McvU+Vhw/8D5r/7taWRrrdI+3JY=; b=jk8chIT24hzK82NYRQXT1X0BqZc1 oDvZMH7zTdqKfRgAIhB03Xk8ZvXWUEU9YxlL5hYObNxaUpHEcJ+BLyKEq0GjDfuB pQtKd1ZjhPemEvI2IiBH1mIuqGQ2iUPxiw5tA+TIl4KNqZv2nrbK2Nhe0CyktLgp VmGFTiI803GWkoQ= 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 Received: (qmail 93477 invoked by uid 89); 14 Jan 2020 18:53:29 -0000 Authentication-Results: sourceware.org; auth=none 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 Content-Transfer-Encoding: 8bit --- 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(-) 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 { -- 2.24.1