From 9f1d1c712dba986c68e14721bc1b50d166c9bb90 Mon Sep 17 00:00:00 2001 From: Balazs Gerofi Date: Sat, 19 May 2012 16:35:52 +0900 Subject: [PATCH] lost wake up (?) futex fix --- kernel/futex.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/futex.c b/kernel/futex.c index b4586fb7..bb1d1ef4 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -231,15 +231,15 @@ static int futex_wait(uint32_t __user *uaddr, uint32_t val, status = -EWOULDBLOCK; goto error; } - - /* Add ourself to the futex queue and drop our lock on it */ - queue_me(&futex, queue); - queue_unlock(queue, irqflags); - + /* Add ourself to the futex's waitq and go to sleep */ cpu_local_var(current)->status = PS_INTERRUPTIBLE; waitq_add_entry(&futex.waitq, &wait); + /* Add ourself to the futex queue and drop our lock on it */ + queue_me(&futex, queue); + queue_unlock(queue, irqflags); + if (!list_empty(&futex.link)) { // We don't have timers for now, let's sleep forever, // and pretend we were woken up