about summary refs log tree commit diff
path: root/nptl/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-03-18 00:50:30 +0000
committerUlrich Drepper <drepper@redhat.com>2003-03-18 00:50:30 +0000
commitf911cc4a7455dfcaf6edb38e7525241ff0268109 (patch)
tree88da21e4b4909b5631e510d8472c101c8cdeb75b /nptl/sysdeps
parent001bea714d6d942a3d67fcf7358f2f469f3c4e3a (diff)
downloadglibc-f911cc4a7455dfcaf6edb38e7525241ff0268109.tar.gz
glibc-f911cc4a7455dfcaf6edb38e7525241ff0268109.tar.xz
glibc-f911cc4a7455dfcaf6edb38e7525241ff0268109.zip
(lll_unlock_wake_cb): Correct last patch. (__lll_timedwait_tid): Don't check abstime for NULL pointer.
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/lowlevellock.c9
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h2
2 files changed, 7 insertions, 4 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/lowlevellock.c b/nptl/sysdeps/unix/sysv/linux/lowlevellock.c
index 4ce42355b5..99f804c986 100644
--- a/nptl/sysdeps/unix/sysv/linux/lowlevellock.c
+++ b/nptl/sysdeps/unix/sysv/linux/lowlevellock.c
@@ -80,8 +80,11 @@ hidden_proto (__lll_timedlock_wait)
 int
 lll_unlock_wake_cb (int *futex)
 {
-  if (__lll_add (futex, 1) + 1 != 0)
-    lll_futex_wake (futex, 1);
+  if (__lll_add (futex, -1) - 1 != 0)
+    {
+      *futex = 0;
+      lll_futex_wake (futex, 1);
+    }
 
   return 0;
 }
@@ -93,7 +96,7 @@ __lll_timedwait_tid (int *tidp, const struct timespec *abstime)
 {
   int tid;
 
-  if (abstime == NULL || abstime->tv_nsec >= 1000000000)
+  if (abstime->tv_nsec >= 1000000000)
     return EINVAL;
 
   /* Repeat until thread terminated.  */
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
index daece67eab..b54ebbfca4 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
@@ -226,7 +226,7 @@ extern int lll_unlock_wake_cb (int *__futex) attribute_hidden;
             __asm __volatile ("cmpl $0, __libc_multiple_threads(%%rip)\n\t"   \
 			      "je 0f\n\t"				      \
 			      "lock\n"					      \
-			      "0:\incl %0\n\t"			      \
+			      "0:\tincl %0\n\t"			      \
 			      "jng 1f\n\t"				      \
 			      ".subsection 1\n"				      \
 			      "1:\tleaq %0, %%rdi\n\t"			      \