summaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'kern/thread.c')
-rw-r--r--kern/thread.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/kern/thread.c b/kern/thread.c
index 33707fd7..fdf2fc3c 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -2068,6 +2068,21 @@ thread_tick_intr(void)
spinlock_unlock(&runq->lock);
}
+char
+thread_state_to_chr(const struct thread *thread)
+{
+ switch (thread->state) {
+ case THREAD_RUNNING:
+ return 'R';
+ case THREAD_SLEEPING:
+ return 'S';
+ case THREAD_DEAD:
+ return 'Z';
+ default:
+ panic("thread: unknown state");
+ }
+}
+
const char *
thread_schedclass_to_str(const struct thread *thread)
{