I'm reading "linux kernel development 3rd".
I have a question about the recommended method for sleeping on page 59.
The method is:

Code:
DEFINE_WAIT(wait);

add_wait_queue(q, &wait);
while (!condition) {
        parepare_to_wait(&q, &wait, TASK_INTERRUPTIBLE);
        if (signal_pending(current))
                /* handle signal */
        schedule();
}
finish_wait(&q, &wait);
My question is, if the condition becomes true and wake_up() is called between while(!condition) and prepare_to_wait(...), will this task sleep forever once calling schedule() ?
Why or why not ?