From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1792) id 3382D3858D32; Mon, 27 Feb 2023 22:12:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3382D3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677535964; bh=Lqxi2ek9ydclrgVzw/MngZw/ekLIcDrtjWRDTWWHf0U=; h=From:To:Subject:Date:From; b=vk2aOWeM0WKoDQxYtBZBmmceTsGNblqNIVq/cDq0yki6pkw8W0VPzUh9i/y604AUb ggQacd1xgQWXYiAi3HEb5AXpcFbOpmPVic8lZKjIv9hsCdeNa/RHJK1HDWjthKeNpn MgZdciYwXiasbj+JgFldaTM79KyhCY+UobUy3Cbg= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Samuel Thibault To: glibc-cvs@sourceware.org Subject: [glibc] htl: Make pthread_mutex_t pointer-aligned X-Act-Checkin: glibc X-Git-Author: Sergey Bugaev X-Git-Refname: refs/heads/master X-Git-Oldrev: 04a558e669801e3eeb32346209fe7a71bc72747f X-Git-Newrev: af0a16a86345ca1f26e956ef44e4b7240bf705cd Message-Id: <20230227221244.3382D3858D32@sourceware.org> Date: Mon, 27 Feb 2023 22:12:44 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=af0a16a86345ca1f26e956ef44e4b7240bf705cd commit af0a16a86345ca1f26e956ef44e4b7240bf705cd Author: Sergey Bugaev Date: Tue Feb 14 20:37:22 2023 +0300 htl: Make pthread_mutex_t pointer-aligned This is for future-proofing. On i386, it is 4-byte aligned anyway, but on x86_64, we want it 8-byte aligned, not 4-byte aligned. Signed-off-by: Sergey Bugaev Message-Id: <20230214173722.428140-4-bugaevc@gmail.com> Diff: --- sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h b/sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h index d7b239f40f..11caa8704b 100644 --- a/sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h +++ b/sysdeps/mach/hurd/htl/bits/types/struct___pthread_mutex.h @@ -30,20 +30,23 @@ struct __pthread_mutex int __shpid; int __type; int __flags; - unsigned int __reserved1; - unsigned int __reserved2; + union + { + unsigned int __reserved[2]; + void *__pointer_aligned; + }; }; /* Static mutex initializers. */ #define __PTHREAD_MUTEX_INITIALIZER \ - { 0, 0, 0, 0, __PTHREAD_MUTEX_TIMED, 0, 0, 0 } + { 0, 0, 0, 0, __PTHREAD_MUTEX_TIMED, 0, { { 0, 0 } } } /* The +1 is to mantain binary compatibility with the old * libpthread implementation. */ #define __PTHREAD_ERRORCHECK_MUTEX_INITIALIZER \ - { 0, 0, 0, 0, __PTHREAD_MUTEX_ERRORCHECK + 1, 0, 0, 0 } + { 0, 0, 0, 0, __PTHREAD_MUTEX_ERRORCHECK + 1, 0, { { 0, 0 } } } #define __PTHREAD_RECURSIVE_MUTEX_INITIALIZER \ - { 0, 0, 0, 0, __PTHREAD_MUTEX_RECURSIVE + 1, 0, 0, 0 } + { 0, 0, 0, 0, __PTHREAD_MUTEX_RECURSIVE + 1, 0, { { 0, 0 } } } #endif /* bits/types/struct___pthread_mutex.h */