Results 1 to 1 of 1
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, ...
- 06-07-2011 #1Just Joined!
- Join Date
- Jun 2011
- Posts
- 1
no condition is checked between prepare_to_wait() and schedule()
I'm reading "linux kernel development 3rd".
I have a question about the recommended method for sleeping on page 59.
The method is:
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() ?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);
Why or why not ?


Reply With Quote
