[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r2246 - in /fsf/trunk/libc: ./ nptl/ nptl/sysdeps/unix/sysv/linux/ sysdeps/x86_64/fpu/



Author: eglibc
Date: Fri May 18 00:02:56 2007
New Revision: 2246

Log:
Import glibc-mainline for 2007-05-18

Added:
    fsf/trunk/libc/nptl/tst-robust9.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/k_cosl.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/k_rem_pio2l.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/k_sinl.c
    fsf/trunk/libc/sysdeps/x86_64/fpu/k_tanl.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/nptl/ChangeLog
    fsf/trunk/libc/nptl/Makefile
    fsf/trunk/libc/nptl/pthread_mutex_lock.c
    fsf/trunk/libc/nptl/pthread_mutex_timedlock.c
    fsf/trunk/libc/nptl/pthread_mutex_trylock.c
    fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sem_wait.c
    fsf/trunk/libc/version.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Fri May 18 00:02:56 2007
@@ -1,7 +1,17 @@
+2007-05-17  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	Dummy files to prevent stub versions from being used.
+	* sysdeps/x86_64/fpu/k_cosl.c: New file.
+	* sysdeps/x86_64/fpu/k_rem_pio2l.c: New file.
+	* sysdeps/x86_64/fpu/k_sinl.c: New file.
+	* sysdeps/x86_64/fpu/k_tanl.c: New file.
+
+	* version.h (VERSION): Set to 2.6.90.
+
 2007-05-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
-	* version.h (VERSION): Define to 6.
-	* include/features.h (__GLIBC_MINOR__): Likewise.
+	* version.h (VERSION): Define to 2.6.
+	* include/features.h (__GLIBC_MINOR__): Define to 6.
 
 	* malloc/malloc.c: Use all small bin slots on 64-bit archs.
 

Modified: fsf/trunk/libc/nptl/ChangeLog
==============================================================================
--- fsf/trunk/libc/nptl/ChangeLog (original)
+++ fsf/trunk/libc/nptl/ChangeLog Fri May 18 00:02:56 2007
@@ -1,3 +1,19 @@
+2007-05-17  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #4512]
+	* pthread_mutex_lock.c: Preserve FUTEX_WAITERS bit when dead owner
+	is detected.
+	* pthread_mutex_timedlock.c: Likewise.
+	* pthread_mutex_trylock.c: Likewise.
+	Patch in part by Atsushi Nemoto <anemo@xxxxxxxxxxxxx>.
+
+	* Makefile (tests): Add tst-robust9 and tst-robustpi9.
+	* tst-robust9.c: New file.
+	* tst-robustpi9.c: New file.
+
+	* sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Remove
+	unnecessary extra cancellation test.
+
 2007-05-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove unnecessary

Modified: fsf/trunk/libc/nptl/Makefile
==============================================================================
--- fsf/trunk/libc/nptl/Makefile (original)
+++ fsf/trunk/libc/nptl/Makefile Fri May 18 00:02:56 2007
@@ -1,4 +1,4 @@
-# Copyright (C) 2002,2003,2004,2005,2006 Free Software Foundation, Inc.
+# Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 
 # The GNU C Library is free software; you can redistribute it and/or
@@ -209,9 +209,9 @@
 	tst-cond14 tst-cond15 tst-cond16 tst-cond17 tst-cond18 tst-cond19 \
 	tst-cond20 tst-cond21 tst-cond22 \
 	tst-robust1 tst-robust2 tst-robust3 tst-robust4 tst-robust5 \
-	tst-robust6 tst-robust7 tst-robust8 \
-	tst-robustpi1 tst-robustpi2 tst-robustpi3 tst-robustpi4 \
-	tst-robustpi5 tst-robustpi6 tst-robustpi7 tst-robustpi8 \
+	tst-robust6 tst-robust7 tst-robust8 tst-robust9 \
+	tst-robustpi1 tst-robustpi2 tst-robustpi3 tst-robustpi4 tst-robustpi5 \
+	tst-robustpi6 tst-robustpi7 tst-robustpi8 tst-robustpi9 \
 	tst-rwlock1 tst-rwlock2 tst-rwlock3 tst-rwlock4 tst-rwlock5 \
 	tst-rwlock6 tst-rwlock7 tst-rwlock8 tst-rwlock9 tst-rwlock10 \
 	tst-rwlock11 tst-rwlock12 tst-rwlock13 tst-rwlock14 \

Modified: fsf/trunk/libc/nptl/pthread_mutex_lock.c
==============================================================================
--- fsf/trunk/libc/nptl/pthread_mutex_lock.c (original)
+++ fsf/trunk/libc/nptl/pthread_mutex_lock.c Fri May 18 00:02:56 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -127,6 +127,8 @@
 	      int newval = id;
 #ifdef NO_INCR
 	      newval |= FUTEX_WAITERS;
+#else
+	      newval |= (oldval & FUTEX_WAITERS);
 #endif
 
 	      newval

Modified: fsf/trunk/libc/nptl/pthread_mutex_timedlock.c
==============================================================================
--- fsf/trunk/libc/nptl/pthread_mutex_timedlock.c (original)
+++ fsf/trunk/libc/nptl/pthread_mutex_timedlock.c Fri May 18 00:02:56 2007
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@xxxxxxxxxx>, 2002.
 
@@ -119,9 +119,11 @@
 	  if ((oldval & FUTEX_OWNER_DIED) != 0)
 	    {
 	      /* The previous owner died.  Try locking the mutex.  */
-	      int newval
+	      int newval = id | (oldval & FUTEX_WAITERS);
+
+	      newval
 		= atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
-						       id, oldval);
+						       newval, oldval);
 	      if (newval != oldval)
 		{
 		  oldval = newval;

Modified: fsf/trunk/libc/nptl/pthread_mutex_trylock.c
==============================================================================
--- fsf/trunk/libc/nptl/pthread_mutex_trylock.c (original)
+++ fsf/trunk/libc/nptl/pthread_mutex_trylock.c Fri May 18 00:02:56 2007
@@ -84,9 +84,11 @@
 	  if ((oldval & FUTEX_OWNER_DIED) != 0)
 	    {
 	      /* The previous owner died.  Try locking the mutex.  */
-	      int newval
+	      int newval = id | (oldval & FUTEX_WAITERS);
+
+	      newval
 		= atomic_compare_and_exchange_val_acq (&mutex->__data.__lock,
-						       id, oldval);
+						       newval, oldval);
 
 	      if (newval != oldval)
 		{

Modified: fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sem_wait.c
==============================================================================
--- fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sem_wait.c (original)
+++ fsf/trunk/libc/nptl/sysdeps/unix/sysv/linux/sem_wait.c Fri May 18 00:02:56 2007
@@ -1,5 +1,5 @@
 /* sem_wait -- wait on a semaphore.  Generic futex-using version.
-   Copyright (C) 2003 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Paul Mackerras <paulus@xxxxxxxxxx>, 2003.
 
@@ -31,9 +31,6 @@
 int
 __new_sem_wait (sem_t *sem)
 {
-  /* First check for cancellation.  */
-  CANCELLATION_P (THREAD_SELF);
-
   int *futex = (int *) sem;
   int err;
 

Added: fsf/trunk/libc/nptl/tst-robust9.c
==============================================================================
--- fsf/trunk/libc/nptl/tst-robust9.c (added)
+++ fsf/trunk/libc/nptl/tst-robust9.c Fri May 18 00:02:56 2007
@@ -1,0 +1,87 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <pthread.h>
+#include <unistd.h>
+#include <sys/time.h>
+
+
+static pthread_mutex_t m;
+
+static void *
+tf (void *data)
+{
+  int err = pthread_mutex_lock (&m);
+  if (err == EOWNERDEAD)
+    {
+      err = pthread_mutex_consistent_np (&m);
+      if (err)
+	{
+	  puts ("pthread_mutex_consistent_np");
+	  exit (1);
+	}
+    }
+  else if (err)
+    {
+      puts ("pthread_mutex_lock");
+      exit (1);
+    }
+  printf ("thread%ld got the lock.\n", (long int) data);
+  sleep (1);
+  /* exit without unlock */
+  return NULL;
+}
+
+static int
+do_test (void)
+{
+  int err, i;
+  pthread_t t[3];
+  pthread_mutexattr_t ma;
+
+  pthread_mutexattr_init (&ma);
+  err = pthread_mutexattr_setrobust_np (&ma, PTHREAD_MUTEX_ROBUST_NP);
+  if (err)
+    {
+      puts ("pthread_mutexattr_setrobust_np");
+      return 1;
+    }
+#ifdef ENABLE_PI
+  if (pthread_mutexattr_setprotocol (&ma, PTHREAD_PRIO_INHERIT) != 0)
+    {
+      puts ("pthread_mutexattr_setprotocol failed");
+      return 1;
+    }
+#endif
+  err = pthread_mutex_init (&m, &ma);
+  if (err)
+    {
+      puts ("pthread_mutex_init");
+      return 1;
+    }
+
+  for (i = 0; i < sizeof (t) / sizeof (t[0]); i++)
+    {
+      err = pthread_create (&t[i], NULL, tf, (void *) (long int) i);
+      if (err)
+	{
+	  puts ("pthread_create");
+	  return 1;
+	}
+    }
+
+  for (i = 0; i < sizeof (t) / sizeof (t[0]); i++)
+    {
+      err = pthread_join (t[i], NULL);
+      if (err)
+	{
+	  puts ("pthread_join");
+	  return 1;
+	}
+    }
+  return 0;
+}
+
+#define TIMEOUT 5
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Added: fsf/trunk/libc/sysdeps/x86_64/fpu/k_cosl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/k_cosl.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/k_cosl.c Fri May 18 00:02:56 2007
@@ -1,0 +1,1 @@
+/*  Not needed.  */

Added: fsf/trunk/libc/sysdeps/x86_64/fpu/k_rem_pio2l.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/k_rem_pio2l.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/k_rem_pio2l.c Fri May 18 00:02:56 2007
@@ -1,0 +1,1 @@
+/*  Not needed.  */

Added: fsf/trunk/libc/sysdeps/x86_64/fpu/k_sinl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/k_sinl.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/k_sinl.c Fri May 18 00:02:56 2007
@@ -1,0 +1,1 @@
+/*  Not needed.  */

Added: fsf/trunk/libc/sysdeps/x86_64/fpu/k_tanl.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/fpu/k_tanl.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/fpu/k_tanl.c Fri May 18 00:02:56 2007
@@ -1,0 +1,1 @@
+/*  Not needed.  */

Modified: fsf/trunk/libc/version.h
==============================================================================
--- fsf/trunk/libc/version.h (original)
+++ fsf/trunk/libc/version.h Fri May 18 00:02:56 2007
@@ -1,4 +1,4 @@
 /* This file just defines the current version number of libc.  */
 
-#define RELEASE "stable"
-#define VERSION "2.6"
+#define RELEASE "development"
+#define VERSION "2.6.90"