about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog1
-rw-r--r--nptl/pthread_cond_init.c9
2 files changed, 6 insertions, 4 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 579e985298..20ae05d91b 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -10,6 +10,7 @@
 	* pthread_condattr_getpshared.c: Adjust for struct pthread_condattr
 	change.
 	* pthread_condattr_setpshared.c: Likewise.
+	* pthread_cond_init.c (__pthread_cond_init): Initialized __clock field.
 	* sysdeps/unix/sysv/linux/lowlevelcond.sym: Add cond_clock symbol.
 	* sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h (pthread_cond_t):
 	Add __clock field.
diff --git a/nptl/pthread_cond_init.c b/nptl/pthread_cond_init.c
index e079ae9235..12a38fb492 100644
--- a/nptl/pthread_cond_init.c
+++ b/nptl/pthread_cond_init.c
@@ -17,7 +17,7 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#include <shlib-compat.h>                  
+#include <shlib-compat.h>
 #include "pthreadP.h"
 
 
@@ -26,11 +26,12 @@ __pthread_cond_init (cond, cond_attr)
      pthread_cond_t *cond;
      const pthread_condattr_t *cond_attr;
 {
-  /* Note that we don't need the COND-ATTR.  It contains only the
-     PSHARED flag which is unimportant here since conditional
-     variables are always usable in multiple processes.  */
+  /* Note that we don't need the PSHARED information from COND-ATTR.
+     Conditional variables are always usable in multiple processes.  */
+  struct pthread_condattr *icond_attr = (struct pthread_condattr *) cond_attr;
 
   cond->__data.__lock = LLL_MUTEX_LOCK_INITIALIZER;
+  cond->__data.__clock = (icond_attr->value & 0xfe) >> 1;
   cond->__data.__total_seq = 0;
   cond->__data.__wakeup_seq = 0;
   cond->__data.__woken_seq = 0;