add threadid

This commit is contained in:
rsc 2006-02-05 17:50:09 +00:00
parent 1b404fe6e4
commit 9eda38e51f
2 changed files with 10 additions and 0 deletions

View file

@ -23,6 +23,7 @@ void _threadsetsysproc(void);
void _threadsleep(Rendez*);
_Thread *_threadwakeup(Rendez*);
#define yield threadyield
int threadid(void);
/*
* I am tired of making this mistake.

View file

@ -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)
{