Removed THREAD_WAIT call completely.

Simply reverse this patch to add THREAD_WAIT
This commit is contained in:
Bahadir Balban
2009-10-31 17:12:03 +02:00
parent dd5e05380c
commit 09197d1fb1
7 changed files with 11 additions and 64 deletions

View File

@@ -49,48 +49,6 @@ int thread_signal_sync(struct ktcb *task, unsigned int flags,
return ret;
}
int thread_wait(struct task_ids *ids)
{
struct ktcb *task, *n;
int ret;
if (!(task = tcb_find(ids->tid))) {
/* Retry in own queue till we find it */
retry:
spin_lock(&current->child_exit_list.list_lock);
list_foreach_removable_struct(task, n,
&current->child_exit_list.list,
task_list) {
if (task->tid == ids->tid) {
printk("%s: Found (%d) in exit queue.\n",
__FUNCTION__, task->tid);
list_remove(&task->task_list);
tcb_delete(task);
spin_unlock(&current->child_exit_list.list_lock);
return 0;
}
}
spin_unlock(&current->child_exit_list.list_lock);
schedule();
goto retry;
}
printk("%s: Found (%d) in global queue.\n",
__FUNCTION__, task->tid);
/* Got a handle on the task, wait on it conditionally */
WAIT_EVENT(&task->wqh_pager,
task->state == TASK_INACTIVE, ret);
/*
* We found it in global queue but
* now it must be in exit queue
*/
ktcb_list_remove(task, &current->child_exit_list);
tcb_delete(task);
return 0;
}
int thread_suspend(struct ktcb *task)
{
return thread_signal_sync(task, TASK_SUSPENDING, TASK_INACTIVE);
@@ -183,6 +141,7 @@ int thread_destroy(struct ktcb *task)
/* Delete all exited children */
spin_lock(&current->child_exit_list.list_lock);
printk("(%d) To delete %d children\n", current->tid, current->child_exit_list.count);
list_foreach_removable_struct(child, n,
&current->child_exit_list.list,
task_list) {
@@ -415,8 +374,7 @@ int sys_thread_control(unsigned int flags, struct task_ids *ids)
MAP_USR_RW_FLAGS, 1)) < 0)
return err;
if ((flags & THREAD_ACTION_MASK) != THREAD_CREATE &&
(flags & THREAD_ACTION_MASK) != THREAD_WAIT)
if ((flags & THREAD_ACTION_MASK) != THREAD_CREATE)
if (!(task = tcb_find(ids->tid)))
return -ESRCH;
@@ -439,9 +397,6 @@ int sys_thread_control(unsigned int flags, struct task_ids *ids)
case THREAD_RECYCLE:
ret = thread_recycle(task);
break;
case THREAD_WAIT:
ret = thread_wait(ids);
break;
default:
ret = -EINVAL;