This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[review v2] nptl: Add struct_rwlock.h
- From: "Florian Weimer (Code Review)" <gerrit at gnutoolchain-gerrit dot osci dot io>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, libc-alpha at sourceware dot org
- Cc: Florian Weimer <fweimer at redhat dot com>
- Date: Thu, 14 Nov 2019 09:37:13 -0500
- Subject: [review v2] nptl: Add struct_rwlock.h
- Auto-submitted: auto-generated
- References: <gerrit.1573136666000.I776a6a986c23199929d28a3dcd30272db21cd1d0@gnutoolchain-gerrit.osci.io>
- Reply-to: gnutoolchain-gerrit at osci dot io
Florian Weimer has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/glibc/+/519
......................................................................
Patch Set 2:
(5 comments)
| --- /dev/null
| +++ /COMMIT_MSG
| @@ -1,0 +1,24 @@
| +Parent: ce345a30 (nptl: Add struct_mutex.h)
| +Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
| +AuthorDate: 2017-11-09 19:41:02 -0200
| +Commit: Adhemerval Zanella <adhemerval.zanella@linaro.org>
| +CommitDate: 2019-11-08 16:42:56 -0300
| +
| +nptl: Add struct_rwlock.h
| +
| +This patch adds a new generic __pthread_rwlock_arch_t definition meant
| +to be used by new ports. Its layout mimic the current usage on some
PS2, Line 10:
mimics
| +64 bits ports and it allows some ports use the generic definition.
PS2, Line 11:
ports to use
| +The arch __pthread_rwlock_arch_t definition is moved from
| +pthreadtypes-arch.h to another arch-specific header (struct_rwlock.h).
| +
| +Also the static intialization macro for pthread_mutex_t is set to use
PS2, Line 15:
wrong type, should be pthread_rwlock_t
| +an arch defined on (__PTHREAD_RWLOCK_INITIALIZER) which simplifies its
| +implementation.
| +
| +The default pthread_rwlock_t layout differs from current ports with:
| +
| + 1. Internal layout is the same for 32 bits and 64 bits.
| +
| + 2. Internal flag is an unsigned short so it should not required
| + additional padding to align for word boundary (if it is the case
| --- /dev/null
| +++ sysdeps/nptl/bits/struct_rwlock.h
| @@ -1,0 +1,10 @@
| +/* Default internal rwlock struct definitions.
PS2, Line 1:
See previous comment about “internal” on the mutex patch.
| + Copyright (C) 2019 Free Software Foundation, Inc.
| +
| + This file is part of the GNU C Library.
| +
| + The GNU C Library is free software; you can redistribute it and/or
| + modify it under the terms of the GNU Lesser General Public
| + License as published by the Free Software Foundation; either
| + version 2.1 of the License, or (at your option) any later version.
| +
| --- sysdeps/nptl/bits/thread-shared-types.h
| +++ sysdeps/nptl/bits/thread-shared-types.h
| @@ -71,8 +68,19 @@ /* Arch-specific mutex definitions. A generic implementation is provided
| 2. __LOCK_ALIGNMENT for any extra attribute for internal lock used with
| atomic operations.
|
| 3. The macro __PTHREAD_MUTEX_INITIALIZER used for static initialization.
| It should initialize the mutex internal flag. */
|
| #include <bits/struct_mutex.h>
|
| +/* Arch-sepecific read-write lock definitions. A generic implementation is
| + provided by sysdeps/nptl/bits/struct_rwlock.h. If required, an
PS2, Line 77:
Path is not appropriate for an installed header.
| + architecture can override it by defining:
| +
| + 1. struct __pthread_rwlock_arch_t (used on pthread_rwlock_t definition).
| + It should contain at least the internal members defined in the
| + generic version.
| +
| + 2. The macro __PTHREAD_RWLOCK_INITIALIZER used for static initialization.
| + It should initialize the rwlock internal type. */
| +
--
Gerrit-Project: glibc
Gerrit-Branch: master
Gerrit-Change-Id: I776a6a986c23199929d28a3dcd30272db21cd1d0
Gerrit-Change-Number: 519
Gerrit-PatchSet: 2
Gerrit-Owner: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Gerrit-Reviewer: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Gerrit-Reviewer: Florian Weimer <fweimer@redhat.com>
Gerrit-Comment-Date: Thu, 14 Nov 2019 14:37:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment