summaryrefslogtreecommitdiffstats
path: root/src/libthread/sched.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-03-05 01:12:11 +0000
committerrsc <devnull@localhost>2004-03-05 01:12:11 +0000
commit02a1a5c18bec9ca13fad2b7b12ae65c580f6fdf4 (patch)
tree456ce23b6ffb80b5c893ce2dfec3b5a88fdf4f63 /src/libthread/sched.c
parent315e309098f8b9f6ee8f869ceef8ea0aacce6c60 (diff)
downloadplan9port-02a1a5c18bec9ca13fad2b7b12ae65c580f6fdf4.tar.gz
plan9port-02a1a5c18bec9ca13fad2b7b12ae65c580f6fdf4.zip
Debugging libthread for acme.
Diffstat (limited to 'src/libthread/sched.c')
-rw-r--r--src/libthread/sched.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/libthread/sched.c b/src/libthread/sched.c
index 755fc280..250a19a2 100644
--- a/src/libthread/sched.c
+++ b/src/libthread/sched.c
@@ -4,7 +4,6 @@
//static Thread *runthread(Proc*);
-#if 0
static char *_psstate[] = {
"Dead",
"Running",
@@ -19,7 +18,6 @@ psstate(int s)
return "unknown";
return _psstate[s];
}
-#endif
void
_schedinit(void *arg)
@@ -271,3 +269,15 @@ yield(void)
_sched();
}
+void
+threadstatus(void)
+{
+ Proc *p;
+ Thread *t;
+
+ p = _threadgetproc();
+ for(t=p->threads.head; t; t=t->nextt)
+ fprint(2, "[%3d] %s userpc=%lux\n",
+ t->id, psstate(t->state), t->userpc);
+}
+