This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Clean pthread types namespaces on x86 and x86_64


On Tue, 23 Jun 2015, Juan Manuel Torres Palma wrote:

> This patch creates the file bits/pthread_ct.h which contains types
> pthread_mutex_t and pthread_cond_t, that were previously in
> pthreadtypes.h. The actual structure declaration
> is in pthread_st.h, that stands for specific types, so now when
> creating mtx_t and cnd_t structs, namespaces won't be corrupted.

I don't think the short cryptic file names are good.  I'd prefer something 
like bits/thread-shared-types.h for the content of types that are shared 
between pthreads and C11 threads, and bits/pthreadtypes-common.h for the 
definitions of pthread_cond_t and pthread_mutex_t in terms of that type 
content.

Mechanical patches such as this one are expected to update all 
architectures to keep the sources bisectable.  That includes creating 
dummy versions of the new headers in the toplevel bits/, like the existing 
bits/pthreadtypes.h, as well as versions of bits/pthread_st.h (which I 
think should be bits/thread-shared-types.h) for each architecture that 
currently has its own bits/pthreadtypes.h,

> +typedef union
> +{
> +	__PTHREAD_MUTEX_T_CONTENT

The indentation looks odd here (and in several other places) - it should 
be two spaces, not a tab (with initial multiples of 8 spaces replaced by 
tabs).

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]