about summary refs log tree commit diff
path: root/nptl/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-05-30 16:32:35 +0000
committerUlrich Drepper <drepper@redhat.com>2003-05-30 16:32:35 +0000
commit4761520e934209d9c28851ba3d51a2be18ea5379 (patch)
treed6035fb9358df67120b03f2976640cd1f49b3a28 /nptl/sysdeps
parent2b1c0eeae3100fc8dc64909a80ea34b2be49bf88 (diff)
downloadglibc-4761520e934209d9c28851ba3d51a2be18ea5379.tar.gz
glibc-4761520e934209d9c28851ba3d51a2be18ea5379.tar.xz
glibc-4761520e934209d9c28851ba3d51a2be18ea5379.zip
(lll_mutex_cond_lock): Add one to value parameter of __lll_lock_wait to reflect reality in the futex syscall.
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
index 877483b22c..eba0ade252 100644
--- a/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
+++ b/nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h
@@ -118,7 +118,10 @@ extern void __lll_lock_wait (int *futex, int val) attribute_hidden;
     int __val = atomic_exchange_and_add (__futex, 2);			      \
     __asm __volatile (__lll_acq_instr ::: "memory");			      \
     if (__builtin_expect (__val != 0, 0))				      \
-      __lll_lock_wait (__futex, __val);					      \
+      /* Note, the val + 1 is kind of ugly here.  __lll_lock_wait will add    \
+	 1 again.  But we added 2 to the futex value so this is the right     \
+	 value which will be passed to the kernel.  */			      \
+      __lll_lock_wait (__futex, __val + 1);				      \
   })
 
 extern int __lll_timedlock_wait