This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Rename some static variables in nptl for readability
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Fri, 15 Mar 2013 15:55:38 +0530
- Subject: [PATCH] Rename some static variables in nptl for readability
Hi,
These bits were part of my initial patch to set things up for default
thread attributes patch, but Roland suggested that I break them up
since they're an unrelated cleanup (the were related earlier since
their names clashed with the default_attr I intended to share across
the library, but I'm calling that variable __default_attr now). So
here it is - the patch renames some static variables in nptl so that
they have unique names. Does not cause any regressions in the
testsuite. OK to commit?
Siddhesh
* pthread_barrier_init.c (default_attr): Rename to
default_barrierattr.
(pthread_barrier_init): Adjust for the rename.
* pthread_mutex_init.c (default_attr): Rename to
default_mutexattr.
(__pthread_mutex_init): Adjust for the rename.
* pthread_rwlock_init.c (default_attr): Rebane to
default_rwlockattr.
(__pthread_rwlock_init): Adjust for the rename.
diff --git a/nptl/pthread_barrier_init.c b/nptl/pthread_barrier_init.c
index d5891fd..6d2910e 100644
--- a/nptl/pthread_barrier_init.c
+++ b/nptl/pthread_barrier_init.c
@@ -22,7 +22,7 @@
#include <kernel-features.h>
-static const struct pthread_barrierattr default_attr =
+static const struct pthread_barrierattr default_barrierattr =
{
.pshared = PTHREAD_PROCESS_PRIVATE
};
@@ -42,7 +42,7 @@ pthread_barrier_init (barrier, attr, count)
const struct pthread_barrierattr *iattr
= (attr != NULL
? iattr = (struct pthread_barrierattr *) attr
- : &default_attr);
+ : &default_barrierattr);
if (iattr->pshared != PTHREAD_PROCESS_PRIVATE
&& __builtin_expect (iattr->pshared != PTHREAD_PROCESS_SHARED, 0))
diff --git a/nptl/pthread_mutex_init.c b/nptl/pthread_mutex_init.c
index 36da3f8..174d900 100644
--- a/nptl/pthread_mutex_init.c
+++ b/nptl/pthread_mutex_init.c
@@ -24,7 +24,7 @@
#include <stap-probe.h>
-static const struct pthread_mutexattr default_attr =
+static const struct pthread_mutexattr default_mutexattr =
{
/* Default is a normal mutex, not shared between processes. */
.mutexkind = PTHREAD_MUTEX_NORMAL
@@ -45,7 +45,8 @@ __pthread_mutex_init (mutex, mutexattr)
assert (sizeof (pthread_mutex_t) <= __SIZEOF_PTHREAD_MUTEX_T);
- imutexattr = (const struct pthread_mutexattr *) mutexattr ?: &default_attr;
+ imutexattr = ((const struct pthread_mutexattr *) mutexattr
+ ?: &default_mutexattr);
/* Sanity checks. */
switch (__builtin_expect (imutexattr->mutexkind
diff --git a/nptl/pthread_rwlock_init.c b/nptl/pthread_rwlock_init.c
index 16bfe2d..29bef71 100644
--- a/nptl/pthread_rwlock_init.c
+++ b/nptl/pthread_rwlock_init.c
@@ -21,7 +21,7 @@
#include <kernel-features.h>
-static const struct pthread_rwlockattr default_attr =
+static const struct pthread_rwlockattr default_rwlockattr =
{
.lockkind = PTHREAD_RWLOCK_DEFAULT_NP,
.pshared = PTHREAD_PROCESS_PRIVATE
@@ -35,7 +35,7 @@ __pthread_rwlock_init (rwlock, attr)
{
const struct pthread_rwlockattr *iattr;
- iattr = ((const struct pthread_rwlockattr *) attr) ?: &default_attr;
+ iattr = ((const struct pthread_rwlockattr *) attr) ?: &default_rwlockattr;
memset (rwlock, '\0', sizeof (*rwlock));