diff options
Diffstat (limited to 'src/libthread/threadimpl.h')
-rw-r--r-- | src/libthread/threadimpl.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/libthread/threadimpl.h b/src/libthread/threadimpl.h index e88e321c..d30d58b6 100644 --- a/src/libthread/threadimpl.h +++ b/src/libthread/threadimpl.h @@ -42,7 +42,11 @@ struct _Procrendez { Lock *l; int asleep; +#ifdef PLAN9PORT_USING_PTHREADS pthread_cond_t cond; +#else + int pid; +#endif }; extern void _procsleep(_Procrendez*); @@ -50,7 +54,14 @@ extern void _procwakeup(_Procrendez*); struct Proc { - pthread_t tid; + Proc *next; + Proc *prev; + char msg[128]; +#ifdef PLAN9PORT_USING_PTHREADS + pthread_t osprocid; +#else + uint osprocid; +#endif Lock lock; _Thread *thread; _Threadlist runqueue; @@ -63,10 +74,12 @@ struct Proc Jmp sigjmp; }; -extern Proc *xxx; #define proc() _threadproc() #define setproc(p) _threadsetproc(p) +extern Proc *_threadprocs; +extern Lock _threadprocslock; + extern void _procstart(Proc*, void (*fn)(Proc*)); extern _Thread *_threadcreate(Proc*, void(*fn)(void*), void*, uint); extern void _threadexit(void); |