start linux pre-2.6 port
This commit is contained in:
parent
fd46554030
commit
4dbefdd41c
5 changed files with 122 additions and 79 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue