Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1587 → Rev 1586

/kernel/trunk/generic/src/proc/task.c
140,26 → 140,6
*/
void task_destroy(task_t *t)
{
spinlock_lock(&tasks_lock);
btree_remove(&tasks_btree, t->taskid, NULL);
spinlock_unlock(&tasks_lock);
 
task_destroy_arch(t);
btree_destroy(&t->futexes);
 
mutex_lock_active(&t->as->lock);
if (--t->as->refcount == 0) {
mutex_unlock(&t->as->lock);
as_destroy(t->as);
/*
* t->as is destroyed.
*/
} else {
mutex_unlock(&t->as->lock);
}
free(t);
TASK = NULL;
}
 
/** Create new task with 1 thread and run it
278,8 → 258,6
spinlock_lock(&ta->lock);
ta->refcount++;
spinlock_unlock(&ta->lock);
 
spinlock_unlock(&tasks_lock);
t = thread_create(ktaskclnp, NULL, ta, 0, "ktaskclnp");