From: H.J. Lu Date: Mon, 14 May 2012 23:48:59 +0000 (-0700) Subject: Add __PTHREAD_RWLOCK_INT_FLAGS_SHARED X-Git-Tag: glibc-2.16-tps~344 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=245a11d7bd3bc44cd2b9f8598516287393705f76;p=thirdparty%2Fglibc.git Add __PTHREAD_RWLOCK_INT_FLAGS_SHARED --- diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 5feb67d2bf6..bf7e11aa9c9 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,10 @@ +2012-05-14 H.J. Lu + + * sysdeps/pthread/pthread.h (__PTHREAD_RWLOCK_INT_FLAGS_SHARED): + New. + (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Check + __PTHREAD_RWLOCK_INT_FLAGS_SHARED instead of __WORDSIZE. + 2012-05-14 H.J. Lu * shlib-versions: Move x86_64-.*-linux.* entry to ... diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h index fcc0ce846b2..88c7c257aef 100644 --- a/nptl/sysdeps/pthread/pthread.h +++ b/nptl/sysdeps/pthread/pthread.h @@ -118,11 +118,20 @@ enum PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP }; +/* Define __PTHREAD_RWLOCK_INT_FLAGS_SHARED to 1 if pthread_rwlock_t + has the shared field. All 64-bit architectures have the shared field + in pthread_rwlock_t. */ +#ifndef __PTHREAD_RWLOCK_INT_FLAGS_SHARED +# if __WORDSIZE == 64 +# define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1 +# endif +#endif + /* Read-write lock initializers. */ # define PTHREAD_RWLOCK_INITIALIZER \ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } } # ifdef __USE_GNU -# if __WORDSIZE == 64 +# ifdef __PTHREAD_RWLOCK_INT_FLAGS_SHARED # define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \ { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }