From 9eda38e51f278aeceefd73bea6835eb929c00328 Mon Sep 17 00:00:00 2001 From: rsc Date: Sun, 5 Feb 2006 17:50:09 +0000 Subject: add threadid --- src/libthread/thread.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/libthread') diff --git a/src/libthread/thread.c b/src/libthread/thread.c index 145a5033..ca4d35af 100644 --- a/src/libthread/thread.c +++ b/src/libthread/thread.c @@ -370,6 +370,15 @@ threadsetstate(char *fmt, ...) va_end(arg); } +int +threadid(void) +{ + _Thread *t; + + t = proc()->thread; + return t->id; +} + void needstack(int n) { -- cgit v1.2.3