This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, master, updated. glibc-2.11-76-gf01c235
- From: drepper at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 17 Dec 2009 21:49:54 -0000
- Subject: GNU C Library master sources branch, master, updated. glibc-2.11-76-gf01c235
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via f01c2359ebd4ed130ea0bfa67b59db896cb55cd5 (commit)
from f282f6b90a52d95370392bd7a4e6ec1bbd90afe5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f01c2359ebd4ed130ea0bfa67b59db896cb55cd5
commit f01c2359ebd4ed130ea0bfa67b59db896cb55cd5
Author: Ulrich Drepper <drepper@redhat.com>
Date: Thu Dec 17 13:49:36 2009 -0800
Small optimization of pthread_rwlock_init.
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index b05f6e4..8cea2f6 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,8 @@
+2009-12-17 Ulrich Drepper <drepper@redhat.com>
+
+ * pthread_rwlock_init.c (__pthread_rwlock_init): Simplify code by
+ using memset.
+
2009-12-01 Dinakar Guniguntala <dino@in.ibm.com>
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.h: Define
diff --git a/nptl/pthread_rwlock_init.c b/nptl/pthread_rwlock_init.c
index 27f25ac..c0aa194 100644
--- a/nptl/pthread_rwlock_init.c
+++ b/nptl/pthread_rwlock_init.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -37,13 +37,7 @@ __pthread_rwlock_init (rwlock, attr)
iattr = ((const struct pthread_rwlockattr *) attr) ?: &default_attr;
- rwlock->__data.__lock = 0;
- rwlock->__data.__nr_readers = 0;
- rwlock->__data.__readers_wakeup = 0;
- rwlock->__data.__writer_wakeup = 0;
- rwlock->__data.__nr_readers_queued = 0;
- rwlock->__data.__nr_writers_queued = 0;
- rwlock->__data.__writer = 0;
+ memset (rwlock, '\0', sizeof (*rwlock));
rwlock->__data.__flags
= iattr->lockkind == PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP;
@@ -56,8 +50,8 @@ __pthread_rwlock_init (rwlock, attr)
0x80 in case private futexes are available and zero otherwise.
This leads to the following table:
- | pshared | result
- | shared private | shared private |
+ | pshared | result
+ | shared private | shared private |
------------+-----------------+-----------------+
!avail 0 | 0 0 | 0 0 |
avail 0x80 | 0x80 0 | 0 0x80 |
@@ -74,9 +68,6 @@ __pthread_rwlock_init (rwlock, attr)
header.private_futex));
#endif
- rwlock->__data.__pad1 = 0;
- rwlock->__data.__pad2 = 0;
-
return 0;
}
strong_alias (__pthread_rwlock_init, pthread_rwlock_init)
-----------------------------------------------------------------------
Summary of changes:
nptl/ChangeLog | 5 +++++
nptl/pthread_rwlock_init.c | 17 ++++-------------
2 files changed, 9 insertions(+), 13 deletions(-)
hooks/post-receive
--
GNU C Library master sources