about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-12-11 09:39:06 +0000
committerUlrich Drepper <drepper@redhat.com>2003-12-11 09:39:06 +0000
commitff48874d6a0d557eee3326b3a53e1503eb48f96d (patch)
tree0a2948e79a83985297a9618c855dd4336bad7100
parent1d9d0b80d1412f8a272e0881d34538a041e56b4b (diff)
downloadglibc-ff48874d6a0d557eee3326b3a53e1503eb48f96d.tar.gz
glibc-ff48874d6a0d557eee3326b3a53e1503eb48f96d.tar.xz
glibc-ff48874d6a0d557eee3326b3a53e1503eb48f96d.zip
Update.
2003-12-11  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
	Assume parameter is a pointer.
	(lll_futex_wake): Likewise.
	Reported by Boris Hu.
	* sysdeps/unix/sysv/linux/unregister-atfork.c
	(__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.

	* sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
-rw-r--r--nptl/ChangeLog11
-rw-r--r--nptl/perf.c8
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sem_wait.c9
-rw-r--r--nptl/sysdeps/unix/sysv/linux/unregister-atfork.c2
4 files changed, 21 insertions, 9 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 441f0baa91..90e321a86c 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,14 @@
+2003-12-11  Ulrich Drepper  <drepper@redhat.com>
+
+	* sysdeps/unix/sysv/linux/i386/lowlevellock.h (lll_futex_wait):
+	Assume parameter is a pointer.
+	(lll_futex_wake): Likewise.
+	Reported by Boris Hu.
+	* sysdeps/unix/sysv/linux/unregister-atfork.c
+	(__unregister_atfork): Pass pointer to refcntr to lll_futex_wait.
+
+	* sysdeps/unix/sysv/linux/sem_wait.c (__new_sem_wait): Simplify a bit.
+
 2003-12-10  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/pthread/bits/libc-lock.h (__rtld_lock_initialize): Define.
diff --git a/nptl/perf.c b/nptl/perf.c
index 515f493069..5b920d719d 100644
--- a/nptl/perf.c
+++ b/nptl/perf.c
@@ -304,7 +304,7 @@ start_threads (void *arg)
 	}
 
       err = pthread_create (&ths[i], &attr, work,
-			    (void *) (rand_r (&state) + starts + i));
+			    (void *) (long) (rand_r (&state) + starts + i));
 
       if (err != 0)
 	error (EXIT_FAILURE, err, "cannot start thread");
@@ -703,7 +703,13 @@ clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
 }
 
 
+#ifdef i386
 #define HP_TIMING_NOW(Var)	__asm__ __volatile__ ("rdtsc" : "=A" (Var))
+#elif defined __ia64__
+#define HP_TIMING_NOW(Var)	__asm__ __volatile__ ("mov %0=ar.itc" : "=r" (Var) : : "memory")
+#else
+#error "HP_TIMING_NOW missing"
+#endif
 
 /* Get current value of CLOCK and store it in TP.  */
 int
diff --git a/nptl/sysdeps/unix/sysv/linux/sem_wait.c b/nptl/sysdeps/unix/sysv/linux/sem_wait.c
index 36bb158e09..e6733e88a3 100644
--- a/nptl/sysdeps/unix/sysv/linux/sem_wait.c
+++ b/nptl/sysdeps/unix/sysv/linux/sem_wait.c
@@ -35,17 +35,12 @@ __new_sem_wait (sem_t *sem)
   CANCELLATION_P (THREAD_SELF);
 
   int *futex = (int *) sem;
-  int val;
   int err;
 
   do
     {
-      if (*futex > 0)
-	{
-	  val = atomic_decrement_if_positive (futex);
-	  if (val > 0)
-	    return 0;
-	}
+      if (atomic_decrement_if_positive (futex) > 0)
+	return 0;
 
       /* Enable asynchronous cancellation.  Required by the standard.  */
       int oldtype = __pthread_enable_asynccancel ();
diff --git a/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c b/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c
index ac4b3c5d4c..72c8d615eb 100644
--- a/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c
+++ b/nptl/sysdeps/unix/sysv/linux/unregister-atfork.c
@@ -104,7 +104,7 @@ __unregister_atfork (dso_handle)
       atomic_decrement (&deleted->handler->refcntr);
       unsigned int val;
       while ((val = deleted->handler->refcntr) != 0)
-	lll_futex_wait (deleted->handler->refcntr, val);
+	lll_futex_wait (&deleted->handler->refcntr, val);
 
       deleted = deleted->next;
     }