From 7387d336ccf8ea5f2c06b2d831029df9f805a14d Mon Sep 17 00:00:00 2001 From: Bora Sahin Date: Tue, 17 Nov 2009 18:13:32 +0200 Subject: [PATCH] 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. --- src/generic/scheduler.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/generic/scheduler.c b/src/generic/scheduler.c index f6934f0..4f88fd2 100644 --- a/src/generic/scheduler.c +++ b/src/generic/scheduler.c @@ -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; }