Added wakeup call during exit in case pager was trying to suspend us.

This commit is contained in:
Bahadir Balban
2009-10-30 12:45:31 +02:00
parent 26aa62d2ea
commit 118fc795d9
5 changed files with 30 additions and 5 deletions

View File

@@ -444,6 +444,7 @@ int sys_thread_control(unsigned int flags, struct task_ids *ids)
case THREAD_RECYCLE:
ret = thread_recycle(task);
break;
default:
ret = -EINVAL;
}

View File

@@ -343,6 +343,12 @@ void sched_die_child(void)
BUG_ON(scheduler.prio_total < 0);
preempt_enable();
/*
* Clear pager waitqueue in case it issued
* a suspend on us (for any reason)
*/
wake_up(&current->wqh_pager, 0);
/*
* Unlock task_dead queue,
* pager can safely delete us
@@ -395,7 +401,7 @@ void sched_suspend_sync(void)
* we silently do so. Noone is waiting us.
*/
if (current->pagerid != current->tid)
wake_up_task(tcb_find(current->pagerid), 0);
wake_up(&current->wqh_pager, 0);
schedule();
}

View File

@@ -141,6 +141,13 @@ void ktcb_list_add(struct ktcb *new, struct ktcb_list *ktcb_list)
mutex_unlock(&ktcb_list->list_lock);
}
void __ktcb_list_add_nolock(struct ktcb *new, struct ktcb_list *ktcb_list)
{
BUG_ON(!list_empty(&new->task_list));
BUG_ON(!++ktcb_list->count);
list_insert(&new->task_list, &ktcb_list->list);
}
void tcb_add(struct ktcb *new)
{
struct container *c = new->container;