Changeset 55ab0f1 in mainline for generic/src/proc/thread.c


Ignore:
Timestamp:
2006-02-04T18:15:13Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
04225a7
Parents:
428aabf
Message:

added thread list to kconsole.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/src/proc/thread.c

    r428aabf r55ab0f1  
    5252#include <arch/atomic.h>
    5353#include <memstr.h>
     54#include <print.h>
    5455
    5556char *thread_states[] = {"Invalid", "Running", "Sleeping", "Ready", "Entering", "Exiting"}; /**< Thread states */
     
    319320        interrupts_restore(ipl);
    320321}
     322
     323/** Print list of threads debug info */
     324void thread_print_list(void)
     325{
     326        link_t *cur;
     327        thread_t *t;
     328        ipl_t ipl;
     329       
     330        /* Messing with thread structures, avoid deadlock */
     331        ipl = interrupts_disable();
     332        spinlock_lock(&threads_lock);
     333
     334        for (cur=threads_head.next; cur!=&threads_head; cur=cur->next) {
     335                t = list_get_instance(cur, thread_t, threads_link);
     336                printf("Thr: %d(%s) ", t->tid, thread_states[t->state]);
     337                if (t->cpu)
     338                        printf("cpu%d ", t->cpu->id);
     339               
     340                printf("\n");
     341        }
     342
     343        spinlock_unlock(&threads_lock);
     344        interrupts_enable();
     345}
Note: See TracChangeset for help on using the changeset viewer.