Thread waiting is fixed.

In the former case, when a child was exiting there was a risk of being preempted while it
was also taken away from the runqueue. In this situatuion, it may not have had
the chance of waking up the parent in case if it waits for the child to exit.

This was also true for suspend & resume so they were patched also.
This commit is contained in:
Bora Sahin
2009-11-17 18:13:32 +02:00
parent a5eede8fb9
commit 7387d336cc

View File

@@ -233,10 +233,10 @@ void sched_exit_sync(void)
sched_rq_remove_task(current);
current->state = TASK_DEAD;
current->flags &= ~TASK_EXITING;
preempt_enable();
if (current->pagerid != current->tid)
wake_up(&current->wqh_pager, 0);
preempt_enable();
schedule();
}
@@ -247,10 +247,10 @@ void sched_exit_async(void)
sched_rq_remove_task(current);
current->state = TASK_DEAD;
current->flags &= ~TASK_EXITING;
preempt_enable();
if (current->pagerid != current->tid)
wake_up(&current->wqh_pager, 0);
preempt_enable();
need_resched = 1;
}
@@ -265,10 +265,10 @@ void sched_suspend_sync(void)
sched_rq_remove_task(current);
current->state = TASK_INACTIVE;
current->flags &= ~TASK_SUSPENDING;
preempt_enable();
if (current->pagerid != current->tid)
wake_up(&current->wqh_pager, 0);
preempt_enable();
schedule();
}
@@ -279,10 +279,10 @@ void sched_suspend_async(void)
sched_rq_remove_task(current);
current->state = TASK_INACTIVE;
current->flags &= ~TASK_SUSPENDING;
preempt_enable();
if (current->pagerid != current->tid)
wake_up(&current->wqh_pager, 0);
preempt_enable();
need_resched = 1;
}