Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2435 → Rev 2436

/trunk/kernel/generic/src/proc/task.c
107,9 → 107,12
t = NULL;
link_t *cur;
for (cur = tasks_btree.leaf_head.next; cur != &tasks_btree.leaf_head; cur = cur->next) {
btree_node_t *node = list_get_instance(cur, btree_node_t, leaf_link);
for (cur = tasks_btree.leaf_head.next;
cur != &tasks_btree.leaf_head; cur = cur->next) {
btree_node_t *node;
node = list_get_instance(cur, btree_node_t, leaf_link);
unsigned int i;
for (i = 0; i < node->keys; i++) {
if ((task_t *) node->value[i] != TASK) {
221,7 → 224,7
*
* @return Task of the running program or NULL on error.
*/
task_t * task_run_program(void *program_addr, char *name)
task_t *task_run_program(void *program_addr, char *name)
{
as_t *as;
as_area_t *a;
/trunk/kernel/generic/src/proc/thread.c
299,6 → 299,15
if (destroy_task)
task_destroy(t->task);
/*
* If the thread had a userspace context, free up its kernel_uarg
* structure.
*/
if (t->flags & THREAD_FLAG_USPACE) {
ASSERT(t->thread_arg);
free(t->thread_arg);
}
 
slab_free(thread_slab, t);
}
 
312,13 → 321,13
* @param flags Thread flags.
* @param name Symbolic name.
* @param uncounted Thread's accounting doesn't affect accumulated task
* accounting.
* accounting.
*
* @return New thread's structure on success, NULL on failure.
*
*/
thread_t *thread_create(void (* func)(void *), void *arg, task_t *task,
int flags, char *name, bool uncounted)
int flags, char *name, bool uncounted)
{
thread_t *t;
ipl_t ipl;
637,7 → 646,8
/** Process syscall to create new thread.
*
*/
unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name, thread_id_t *uspace_thread_id)
unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name,
thread_id_t *uspace_thread_id)
{
thread_t *t;
char namebuf[THREAD_NAME_BUFLEN];
660,8 → 670,8
if (t) {
thread_ready(t);
if (uspace_thread_id != NULL)
return (unative_t) copy_to_uspace(uspace_thread_id, &t->tid,
sizeof(t->tid));
return (unative_t) copy_to_uspace(uspace_thread_id,
&t->tid, sizeof(t->tid));
else
return 0;
} else