mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 10:53:16 +01:00
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:
@@ -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(¤t->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(¤t->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(¤t->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(¤t->wqh_pager, 0);
|
||||
preempt_enable();
|
||||
|
||||
need_resched = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user