From 4dbefdd41ca866a10cee633a3ee9a67d9204b052 Mon Sep 17 00:00:00 2001 From: rsc Date: Mon, 27 Dec 2004 16:52:26 +0000 Subject: start linux pre-2.6 port --- src/libthread/threadimpl.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/libthread/threadimpl.h') 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); -- cgit v1.2.3