Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1059 → Rev 1060

/kernel/trunk/generic/src/proc/task.c
38,6 → 38,7
#include <adt/list.h>
#include <ipc/ipc.h>
#include <memstr.h>
#include <print.h>
 
#include <elf.h>
 
131,3 → 132,33
 
return task;
}
 
/** Print task list */
void task_print_list(void)
{
link_t *cur;
task_t *t;
ipl_t ipl;
int i;
/* Messing with thread structures, avoid deadlock */
ipl = interrupts_disable();
spinlock_lock(&tasks_lock);
 
for (cur=tasks_head.next; cur!=&tasks_head; cur=cur->next) {
t = list_get_instance(cur, task_t, tasks_link);
spinlock_lock(&t->lock);
printf("Task: %Q ActiveCalls: %d", t->taskid,
atomic_get(&t->active_calls));
for (i=0; i < IPC_MAX_PHONES; i++) {
if (t->phones[i].callee)
printf(" Ph(%d): %P ", i,t->phones[i].callee);
}
printf("\n");
spinlock_unlock(&t->lock);
}
 
spinlock_unlock(&tasks_lock);
interrupts_restore(ipl);
}
/kernel/trunk/generic/src/proc/thread.c
412,10 → 412,9
printf("Thr: %d(%s) ", t->tid, thread_states[t->state]);
if (t->cpu)
printf("cpu%d ", t->cpu->id);
printf("\n");
}
 
spinlock_unlock(&threads_lock);
interrupts_enable();
interrupts_restore(ipl);
}