From 1c3f9acf1f1f75faa7a28bf39af64afda93839ac Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Wed, 8 Nov 2017 09:23:34 -0200 Subject: nptl: Add struct_mutex.h The current way of defining the common mutex definition for POSIX and C11 on pthreadtypes-arch.h (added by commit 06be6368da16104be5) is not really the best options for newer ports. It requires define some misleading flags that should be always defined as 0 (__PTHREAD_COMPAT_PADDING_MID and __PTHREAD_COMPAT_PADDING_END), it exposes options used solely for linuxthreads compat mode (__PTHREAD_MUTEX_USE_UNION and __PTHREAD_MUTEX_NUSERS_AFTER_KIND), and requires newer ports to explicit define them (adding more boilerplate code). This patch adds a new default __pthread_mutex_s definition meant to be used by newer ports. Its layout mimics the current usage on both 32 and 64 bits ports and it allows most ports to use the generic definition. Only ports that use some arch-specific definition (such as hardware lock-elision or linuxthreads compat) requires specific headers. For 32 bit, the generic definitions mimic the other 32-bit ports of using an union to define the fields uses on adaptive and robust mutexes (thus not allowing both usage at same time) and by using a single linked-list for robust mutexes. Both decisions seemed to follow what recent ports have done and make the resulting pthread_mutex_t/mtx_t object smaller. Also the static intialization macro for pthread_mutex_t is set to use a macro __PTHREAD_MUTEX_INITIALIZER where the architecture can redefine in its struct_mutex.h if it requires additional fields to be initialized. Checked with a build on affected abis. Change-Id: I30a22c3e3497805fd6e52994c5925897cffcfe13 --- sysdeps/ia64/nptl/bits/pthreadtypes-arch.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'sysdeps/ia64/nptl') diff --git a/sysdeps/ia64/nptl/bits/pthreadtypes-arch.h b/sysdeps/ia64/nptl/bits/pthreadtypes-arch.h index 8eb1bd5ebe..7a1fd3ed28 100644 --- a/sysdeps/ia64/nptl/bits/pthreadtypes-arch.h +++ b/sysdeps/ia64/nptl/bits/pthreadtypes-arch.h @@ -29,13 +29,6 @@ #define __SIZEOF_PTHREAD_BARRIER_T 32 #define __SIZEOF_PTHREAD_BARRIERATTR_T 4 -/* Definitions for internal mutex struct. */ -#define __PTHREAD_COMPAT_PADDING_MID -#define __PTHREAD_COMPAT_PADDING_END -#define __PTHREAD_MUTEX_LOCK_ELISION 0 -#define __PTHREAD_MUTEX_NUSERS_AFTER_KIND 0 -#define __PTHREAD_MUTEX_USE_UNION 0 - #define __LOCK_ALIGNMENT #define __ONCE_ALIGNMENT -- cgit 1.4.1