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]

[review v2] nptl: Add struct_rwlock.h


Adhemerval Zanella 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:

Ack

| +64 bits ports and it allows some ports use the generic definition.

PS2, Line 11:

Ack

| +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:

Ack

| +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:

I changed to 'Default read-write lock implementation struct
definitions.'.

| +   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:

As for mutex, I removed the path.

| +   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: Wed, 20 Nov 2019 14:49:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Florian Weimer <fweimer@redhat.com>
Gerrit-MessageType: comment


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