This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/7008] New: pthread_condattr_setclock will modify the attribute of condition to PTHREAD_PROCESS_PRIVATE
- From: "chul at cn dot fujitsu dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 6 Nov 2008 02:06:18 -0000
- Subject: [Bug nptl/7008] New: pthread_condattr_setclock will modify the attribute of condition to PTHREAD_PROCESS_PRIVATE
- Reply-to: sourceware-bugzilla at sourceware dot org
When I make some tests for nptl, I found pthread_condattr_setclock will always
modify the attribute of condition to PTHREAD_PROCESS_PRIVATE, even if the
condition is set as PTHREAD_PROCESS_SHARED at first. So the program will be
hung if condition is used for LWP.
The following line is wrong in nptl/pthread_condattr_setclock.c:
*valuep = ((*valuep & ~(1 << (COND_NWAITERS_SHIFT + 1)) & ~1)
| (clock_id << 1));
I think it should be correct as follows:
*valuep = ((*valuep & ~(1 << (COND_NWAITERS_SHIFT + 1)) & ~0)
| (clock_id << 1));
--
Summary: pthread_condattr_setclock will modify the attribute of
condition to PTHREAD_PROCESS_PRIVATE
Product: glibc
Version: 2.8
Status: NEW
Severity: normal
Priority: P2
Component: nptl
AssignedTo: drepper at redhat dot com
ReportedBy: chul at cn dot fujitsu dot com
CC: glibc-bugs at sources dot redhat dot com
GCC build triplet: x86
GCC host triplet: x86
GCC target triplet: x86
http://sourceware.org/bugzilla/show_bug.cgi?id=7008
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.