[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commits] r9490 - in /fsf/trunk/libc/nptl: ChangeLog pthread_rwlock_init.c
- To: commits@xxxxxxxxxx
- Subject: [commits] r9490 - in /fsf/trunk/libc/nptl: ChangeLog pthread_rwlock_init.c
- From: eglibc@xxxxxxxxxx
- Date: Fri, 18 Dec 2009 08:03:58 -0000
Author: eglibc
Date: Fri Dec 18 00:03:56 2009
New Revision: 9490
Log:
Import glibc-mainline for 2009-12-18
Modified:
fsf/trunk/libc/nptl/ChangeLog
fsf/trunk/libc/nptl/pthread_rwlock_init.c
Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Fri Dec 18 00:03:56 2009
@@ -1,3 +1,8 @@
+2009-12-17 Ulrich Drepper <drepper@xxxxxxxxxx>
+
+ * pthread_rwlock_init.c (__pthread_rwlock_init): Simplify code by
+ using memset.
+
2009-12-01 Dinakar Guniguntala <dino@xxxxxxxxxx>
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.h: Define
Modified: fsf/trunk/libc/nptl/pthread_rwlock_init.c
==============================================================================
--- fsf/trunk/libc/nptl/pthread_rwlock_init.c (original)
+++ fsf/trunk/libc/nptl/pthread_rwlock_init.c Fri Dec 18 00:03:56 2009
@@ -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@xxxxxxxxxx>, 2002.
@@ -37,13 +37,7 @@
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 @@
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 @@
header.private_futex));
#endif
- rwlock->__data.__pad1 = 0;
- rwlock->__data.__pad2 = 0;
-
return 0;
}
strong_alias (__pthread_rwlock_init, pthread_rwlock_init)