From f911cc4a7455dfcaf6edb38e7525241ff0268109 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 18 Mar 2003 00:50:30 +0000 Subject: (lll_unlock_wake_cb): Correct last patch. (__lll_timedwait_tid): Don't check abstime for NULL pointer. --- nptl/sysdeps/unix/sysv/linux/lowlevellock.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'nptl/sysdeps/unix/sysv/linux/lowlevellock.c') 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. */ -- cgit v1.2.3-70-g09d2