From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20196 invoked by alias); 2 Jan 2003 18:03:06 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 20153 invoked from network); 2 Jan 2003 18:03:04 -0000 Received: from unknown (HELO sunsite.mff.cuni.cz) (195.113.19.66) by 209.249.29.67 with SMTP; 2 Jan 2003 18:03:04 -0000 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.11.6/8.11.6) id h02I2g220422; Thu, 2 Jan 2003 19:02:42 +0100 Date: Thu, 02 Jan 2003 18:03:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers Subject: [PATCH] linuxthreads pthread_cond_t Message-ID: <20030102190242.G1218@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-SW-Source: 2003-01/txt/msg00006.txt.bz2 Hi! pthread_cond_t in NPTL wants long long alignment, so linuxthreads should do the same, otherwise on 32-bit arches where __alignof(long long) > 4 binaries/libs compiled against linuxthreads -lpthread might not work with NPTL libs. Haven't used __attribute__((aligned (__alignof__ (long long)))) to cope with non-GCC compilers. 2003-01-02 Jakub Jelinek * sysdeps/pthread/bits/pthreadtypes.h (__pthread_cond_align_t): New type. (pthread_cond_t): Add __align member, shorten __padding. * sysdeps/pthread/pthread.h (PHTREAD_COND_INITIALIZER): Initialize __padding and __align too. --- libc/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h.jj 2003-01-02 14:49:58.000000000 +0100 +++ libc/linuxthreads/sysdeps/pthread/bits/pthreadtypes.h 2003-01-02 19:57:25.000000000 +0100 @@ -53,12 +53,20 @@ typedef struct __pthread_attr_s /* Conditions (not abstract because of PTHREAD_COND_INITIALIZER */ + +#ifdef __GLIBC_HAVE_LONG_LONG +__extension__ typedef long long __pthread_cond_align_t; +#else +typedef long __pthread_cond_align_t; +#endif + typedef struct { struct _pthread_fastlock __c_lock; /* Protect against concurrent access */ _pthread_descr __c_waiting; /* Threads waiting on this condition */ char __padding[48 - sizeof (struct _pthread_fastlock) - - sizeof (_pthread_descr)]; + - sizeof (_pthread_descr) - sizeof (__pthread_cond_align_t)]; + __pthread_cond_align_t __align; } pthread_cond_t; --- libc/linuxthreads/sysdeps/pthread/pthread.h.jj 2002-06-05 10:27:29.000000000 +0200 +++ libc/linuxthreads/sysdeps/pthread/pthread.h 2003-01-02 20:20:34.000000000 +0100 @@ -41,7 +41,7 @@ __BEGIN_DECLS {0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, __LOCK_INITIALIZER} #endif -#define PTHREAD_COND_INITIALIZER {__LOCK_INITIALIZER, 0} +#define PTHREAD_COND_INITIALIZER {__LOCK_INITIALIZER, 0, "", 0} #ifdef __USE_UNIX98 # define PTHREAD_RWLOCK_INITIALIZER \ Jakub