Supply prototypes where possible. This uncovered type errors with
thread entrypoints: (lwpSelect, shutdown_sequence): Parameters didn't match thread entry point prototype. (lwpEntryPoint): Arguments didn't match thread entry point prototype. Change linkage of functions without prototype declaration to static where possible. Remove some superflous declarations, replace others by suitable includes.
This commit is contained in:
parent
7dbb87b0e0
commit
237baffca9
108 changed files with 505 additions and 877 deletions
|
@ -48,7 +48,8 @@ static struct lwpProc *tempcontext;
|
|||
struct lwpProc *initcontext = NULL;
|
||||
int startpoint;
|
||||
|
||||
startcontext()
|
||||
static void
|
||||
startcontext(void)
|
||||
{
|
||||
int space[10000];
|
||||
int x;
|
||||
|
@ -64,9 +65,7 @@ startcontext()
|
|||
}
|
||||
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
struct lwpProc *newp;
|
||||
void *sp;
|
||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||
{
|
||||
struct lwpProc holder;
|
||||
int endpoint;
|
||||
|
@ -96,9 +95,7 @@ void *sp;
|
|||
#elif defined(hpux)
|
||||
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
volatile struct lwpProc *volatile newp;
|
||||
void *sp;
|
||||
lwpInitContext(volatile struct lwpProc *volatile newp, void *sp)
|
||||
{
|
||||
static jmp_buf *cpp;
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
|
@ -113,8 +110,7 @@ void *sp;
|
|||
}
|
||||
|
||||
int
|
||||
lwpSave(jb)
|
||||
jmp_buf jb;
|
||||
lwpSave(jmp_buf jb)
|
||||
{
|
||||
/* save stack pointer and return program counter */
|
||||
asm("stw %sp, 4(%arg0)");
|
||||
|
@ -149,8 +145,7 @@ jmp_buf jb;
|
|||
}
|
||||
|
||||
void
|
||||
lwpRestore(jb)
|
||||
jmp_buf jb;
|
||||
lwpRestore(jmp_buf jb)
|
||||
{
|
||||
/* restore stack pointer and program counter */
|
||||
asm volatile ("ldw 4(%arg0), %sp");
|
||||
|
@ -185,9 +180,7 @@ jmp_buf jb;
|
|||
|
||||
#elif defined(BSD386)
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
struct lwpProc *newp;
|
||||
void *sp;
|
||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||
{
|
||||
newp->context[2] = (int)sp;
|
||||
newp->context[0] = (int)lwpEntryPoint;
|
||||
|
@ -196,9 +189,7 @@ void *sp;
|
|||
#elif defined(FBSD)
|
||||
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
struct lwpProc *newp;
|
||||
void *sp;
|
||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||
{
|
||||
setjmp(newp->context);
|
||||
newp->context->_jb[2] = (int)sp;
|
||||
|
@ -209,9 +200,7 @@ void *sp;
|
|||
#elif defined(__linux__)
|
||||
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
struct lwpProc *newp;
|
||||
void *sp;
|
||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||
{
|
||||
#if defined(__GLIBC__) && (__GLIBC__ >= 2)
|
||||
#if defined(__PPC__)
|
||||
|
@ -232,9 +221,7 @@ void *sp;
|
|||
#elif defined(SUN3)
|
||||
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
struct lwpProc *newp;
|
||||
void *sp;
|
||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||
{
|
||||
newp->context[2] = (int)sp;
|
||||
newp->context[3] = (int)lwpEntryPoint;
|
||||
|
@ -245,9 +232,7 @@ void *sp;
|
|||
#include <stdio.h>
|
||||
|
||||
void
|
||||
lwpInitContext(newp, stack)
|
||||
struct lwpProc *newp;
|
||||
void *stack;
|
||||
lwpInitContext(struct lwpProc *newp, void *stack)
|
||||
{
|
||||
int *sp = (int *)stack;
|
||||
int *fp = 0;
|
||||
|
@ -282,8 +267,7 @@ void *stack;
|
|||
}
|
||||
|
||||
int
|
||||
lwpSave(jb)
|
||||
jmp_buf jb;
|
||||
lwpSave(jmp_buf jb)
|
||||
{
|
||||
asm("movl 4(ap), r0"); /* r0 = &jb */
|
||||
asm("movl r6, (r0)"); /* jb[0] = r6 */
|
||||
|
@ -298,8 +282,7 @@ jmp_buf jb;
|
|||
}
|
||||
|
||||
void
|
||||
lwpRestore(jb)
|
||||
jmp_buf jb;
|
||||
lwpRestore(jmp_buf jb)
|
||||
{
|
||||
asm("movl 4(ap), r0"); /* r0 = &jb */
|
||||
asm("movl (r0), r6"); /* r6 = jb[0] */
|
||||
|
@ -319,9 +302,7 @@ jmp_buf jb;
|
|||
#elif defined(SUN4)
|
||||
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
struct lwpProc *newp;
|
||||
void *sp;
|
||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||
{
|
||||
static jmp_buf *cpp;
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
|
@ -377,9 +358,7 @@ void *sp;
|
|||
*/
|
||||
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
struct lwpProc *newp;
|
||||
void *sp;
|
||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||
{
|
||||
newp->context[4] = (int)sp;
|
||||
newp->context[5] = (int)lwpEntryPoint;
|
||||
|
@ -395,9 +374,7 @@ void *sp;
|
|||
*/
|
||||
|
||||
void
|
||||
lwpInitContext(newp, spp)
|
||||
struct lwpProc *newp;
|
||||
stack_t *spp;
|
||||
lwpInitContext(struct lwpProc *newp, stack_t *spp)
|
||||
{
|
||||
getcontext(&(newp->context));
|
||||
newp->context.uc_stack.ss_sp = spp->ss_sp;
|
||||
|
@ -410,9 +387,7 @@ stack_t *spp;
|
|||
#include <c_asm.h>
|
||||
|
||||
void
|
||||
lwpInitContext(newp, sp)
|
||||
struct lwpProc *newp;
|
||||
void *sp;
|
||||
lwpInitContext(struct lwpProc *newp, void *sp)
|
||||
{
|
||||
extern long *_gp;
|
||||
|
||||
|
@ -425,15 +400,13 @@ void *sp;
|
|||
}
|
||||
|
||||
int
|
||||
lwpSave(jb)
|
||||
jmp_buf jb;
|
||||
lwpSave(jmp_buf jb)
|
||||
{
|
||||
return _setjmp(jb);
|
||||
}
|
||||
|
||||
void
|
||||
lwpRestore(jb)
|
||||
jmp_buf jb;
|
||||
lwpRestore(jmp_buf jb)
|
||||
{
|
||||
/* resume, but get the pv from the jmp_buf */
|
||||
asm("ldq %pv, 248(%a0)");
|
||||
|
|
|
@ -58,14 +58,13 @@ static int oldmask;
|
|||
extern char *strdup();
|
||||
#endif /* NOSTRDUP */
|
||||
|
||||
static void lwpStackCheckInit();
|
||||
static int lwpStackCheck();
|
||||
static void lwpStackCheckUsed();
|
||||
static void lwpStackCheckInit(struct lwpProc *newp);
|
||||
static int lwpStackCheck(struct lwpProc *newp);
|
||||
static void lwpStackCheckUsed(struct lwpProc *newp);
|
||||
|
||||
/* check stack direction */
|
||||
static int
|
||||
growsdown(x)
|
||||
void *x;
|
||||
growsdown(void *x)
|
||||
{
|
||||
int y;
|
||||
|
||||
|
@ -86,7 +85,7 @@ void *x;
|
|||
* processes here and free them.
|
||||
*/
|
||||
void
|
||||
lwpReschedule()
|
||||
lwpReschedule(void)
|
||||
{
|
||||
extern struct lwpQueue LwpSchedQ[];
|
||||
static int lcount = LCOUNT;
|
||||
|
@ -195,9 +194,8 @@ lwpReschedule()
|
|||
* lwpEntryPoint -- process entry point.
|
||||
*/
|
||||
void
|
||||
lwpEntryPoint()
|
||||
lwpEntryPoint(void)
|
||||
{
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
#ifdef POSIXSIGNALS
|
||||
sigset_t set;
|
||||
#endif /* POSIXSIGNALS */
|
||||
|
@ -215,8 +213,7 @@ lwpEntryPoint()
|
|||
*LwpContextPtr = LwpCurrent->ud;
|
||||
|
||||
lwpStatus(LwpCurrent, "starting at entry point");
|
||||
(*LwpCurrent->entry) (LwpCurrent->argc, LwpCurrent->argv,
|
||||
LwpCurrent->ud);
|
||||
(*LwpCurrent->entry)(LwpCurrent->ud);
|
||||
lwpExit();
|
||||
#ifdef BOUNDS_CHECK
|
||||
BOUNDS_CHECKING_ON;
|
||||
|
@ -229,18 +226,8 @@ lwpEntryPoint()
|
|||
* lwpCreate -- create a process.
|
||||
*/
|
||||
struct lwpProc *
|
||||
lwpCreate(priority, entry, size, flags, name, desc, argc, argv, ud)
|
||||
int priority;
|
||||
void (*entry) ();
|
||||
int size;
|
||||
int flags;
|
||||
char *name;
|
||||
char *desc;
|
||||
int argc;
|
||||
char *argv[];
|
||||
void *ud;
|
||||
lwpCreate(int priority, void (*entry)(void *), int size, int flags, char *name, char *desc, int argc, char **argv, void *ud)
|
||||
{
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
struct lwpProc *newp;
|
||||
int *s, x;
|
||||
#ifdef UCONTEXT
|
||||
|
@ -329,8 +316,7 @@ void *ud;
|
|||
}
|
||||
|
||||
void
|
||||
lwpDestroy(proc)
|
||||
struct lwpProc *proc;
|
||||
lwpDestroy(struct lwpProc *proc)
|
||||
{
|
||||
if (proc->flags & LWP_STACKCHECK) {
|
||||
lwpStackCheckUsed(proc);
|
||||
|
@ -355,12 +341,8 @@ struct lwpProc *proc;
|
|||
* lwpReady -- put process on ready queue. if null, assume current.
|
||||
*/
|
||||
void
|
||||
lwpReady(p)
|
||||
struct lwpProc *p;
|
||||
lwpReady(struct lwpProc *p)
|
||||
{
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
extern struct lwpQueue LwpSchedQ[];
|
||||
|
||||
if (!p)
|
||||
p = LwpCurrent;
|
||||
lwpStatus(p, "added to run queue");
|
||||
|
@ -371,8 +353,7 @@ struct lwpProc *p;
|
|||
* return user's data
|
||||
*/
|
||||
void *
|
||||
lwpGetUD(p)
|
||||
struct lwpProc *p;
|
||||
lwpGetUD(struct lwpProc *p)
|
||||
{
|
||||
if (!p)
|
||||
p = LwpCurrent;
|
||||
|
@ -383,9 +364,7 @@ struct lwpProc *p;
|
|||
* set user's data
|
||||
*/
|
||||
void
|
||||
lwpSetUD(p, ud)
|
||||
struct lwpProc *p;
|
||||
char *ud;
|
||||
lwpSetUD(struct lwpProc *p, char *ud)
|
||||
{
|
||||
if (!p)
|
||||
p = LwpCurrent;
|
||||
|
@ -396,10 +375,7 @@ char *ud;
|
|||
* set name & desc
|
||||
*/
|
||||
void
|
||||
lwpSetDesc(p, name, desc)
|
||||
struct lwpProc *p;
|
||||
char *name;
|
||||
char *desc;
|
||||
lwpSetDesc(struct lwpProc *p, char *name, char *desc)
|
||||
{
|
||||
if (!p)
|
||||
p = LwpCurrent;
|
||||
|
@ -413,7 +389,7 @@ char *desc;
|
|||
* lwpYield -- yield the processor to another thread.
|
||||
*/
|
||||
void
|
||||
lwpYield()
|
||||
lwpYield(void)
|
||||
{
|
||||
lwpStatus(LwpCurrent, "yielding control");
|
||||
lwpReady(LwpCurrent);
|
||||
|
@ -424,7 +400,7 @@ lwpYield()
|
|||
* cause the current process to be scheduled for deletion.
|
||||
*/
|
||||
void
|
||||
lwpExit()
|
||||
lwpExit(void)
|
||||
{
|
||||
lwpStatus(LwpCurrent, "marking self as dead");
|
||||
LwpCurrent->dead = 1;
|
||||
|
@ -436,8 +412,7 @@ lwpExit()
|
|||
* remove any lingering FD action
|
||||
*/
|
||||
void
|
||||
lwpTerminate(p)
|
||||
struct lwpProc *p;
|
||||
lwpTerminate(struct lwpProc *p)
|
||||
{
|
||||
lwpStatus(p, "terminating process");
|
||||
p->dead = 1;
|
||||
|
@ -450,8 +425,7 @@ struct lwpProc *p;
|
|||
* if the new priority is lower than the old, we reschedule.
|
||||
*/
|
||||
int
|
||||
lwpSetPriority(new)
|
||||
int new;
|
||||
lwpSetPriority(int new)
|
||||
{
|
||||
int old = LwpCurrent->pri;
|
||||
|
||||
|
@ -470,13 +444,8 @@ int new;
|
|||
* initialise the coroutine structures
|
||||
*/
|
||||
struct lwpProc *
|
||||
lwpInitSystem(pri, ctxptr, flags)
|
||||
int pri;
|
||||
char **ctxptr;
|
||||
int flags;
|
||||
lwpInitSystem(int pri, char **ctxptr, int flags)
|
||||
{
|
||||
extern struct lwpQueue LwpSchedQ[];
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
struct lwpQueue *q;
|
||||
int i, *stack;
|
||||
struct lwpProc *sel;
|
||||
|
@ -517,8 +486,7 @@ int flags;
|
|||
* used.
|
||||
*/
|
||||
static void
|
||||
lwpStackCheckInit(newp)
|
||||
struct lwpProc *newp;
|
||||
lwpStackCheckInit(struct lwpProc *newp)
|
||||
{
|
||||
register int i;
|
||||
register long *lp;
|
||||
|
@ -542,8 +510,7 @@ struct lwpProc *newp;
|
|||
* down the entire process.
|
||||
*/
|
||||
static int
|
||||
lwpStackCheck(newp)
|
||||
struct lwpProc *newp;
|
||||
lwpStackCheck(struct lwpProc *newp)
|
||||
{
|
||||
register int end, amt;
|
||||
register unsigned int i;
|
||||
|
@ -602,8 +569,7 @@ struct lwpProc *newp;
|
|||
* Figure out how much stack was used by this thread.
|
||||
*/
|
||||
static void
|
||||
lwpStackCheckUsed(newp)
|
||||
struct lwpProc *newp;
|
||||
lwpStackCheckUsed(struct lwpProc *newp)
|
||||
{
|
||||
register int i;
|
||||
register long *lp;
|
||||
|
|
|
@ -30,13 +30,13 @@
|
|||
#define LCOUNT -1
|
||||
|
||||
#ifdef hpux
|
||||
int lwpSave _PROTO((jmp_buf));
|
||||
void lwpRestore _PROTO((jmp_buf));
|
||||
int lwpSave(jmp_buf);
|
||||
void lwpRestore(jmp_buf);
|
||||
#endif
|
||||
|
||||
#if defined(MIPS) || defined(AIX32) || defined(ALPHA) || defined(__vax)
|
||||
int lwpSave _PROTO((jmp_buf));
|
||||
void lwpRestore _PROTO((jmp_buf));
|
||||
int lwpSave(jmp_buf);
|
||||
void lwpRestore(jmp_buf);
|
||||
#elif defined(SUN4)
|
||||
#define lwpSave(x) _setjmp(x)
|
||||
#define lwpRestore(x) _longjmp(x, 1)
|
||||
|
@ -78,27 +78,27 @@ typedef struct {
|
|||
#endif
|
||||
|
||||
/* internal routines */
|
||||
void lwpAddTail _PROTO((struct lwpQueue *, struct lwpProc *));
|
||||
struct lwpProc *lwpGetFirst _PROTO((struct lwpQueue *));
|
||||
void lwpReschedule _PROTO((void));
|
||||
void lwpReady _PROTO((struct lwpProc *));
|
||||
void lwpOnalarm _PROTO((void));
|
||||
void lwpAddTail(struct lwpQueue *, struct lwpProc *);
|
||||
struct lwpProc *lwpGetFirst(struct lwpQueue *);
|
||||
void lwpReschedule(void);
|
||||
void lwpReady(struct lwpProc *);
|
||||
void lwpOnalarm(void);
|
||||
|
||||
#ifdef UCONTEXT
|
||||
void lwpInitContext _PROTO((struct lwpProc *, stack_t *));
|
||||
void lwpInitContext(struct lwpProc *, stack_t *);
|
||||
#else /* GETCONTEXT */
|
||||
#ifdef hpc
|
||||
void lwpInitContext _PROTO((struct lwpProc *, void *));
|
||||
void lwpInitContext(struct lwpProc *, void *);
|
||||
#else
|
||||
#ifdef hpux
|
||||
void lwpInitContext _PROTO((volatile struct lwpProc * volatile, void *));
|
||||
void lwpInitContext(volatile struct lwpProc * volatile, void *);
|
||||
#else
|
||||
void lwpInitContext _PROTO((struct lwpProc *, void *));
|
||||
void lwpInitContext(struct lwpProc *, void *);
|
||||
#endif /* hpux */
|
||||
#endif /* hpc */
|
||||
#endif /* GETCONTEXT */
|
||||
void lwpEntryPoint _PROTO((void));
|
||||
void lwpInitSelect _PROTO((struct lwpProc * self));
|
||||
void lwpDestroy _PROTO((struct lwpProc * proc));
|
||||
void lwpEntryPoint(void);
|
||||
void lwpInitSelect(struct lwpProc * self);
|
||||
void lwpDestroy(struct lwpProc * proc);
|
||||
|
||||
#endif /* _LWP_H */
|
||||
|
|
|
@ -23,14 +23,6 @@
|
|||
#ifndef _LWP_H
|
||||
#define _LWP_H
|
||||
|
||||
#ifndef _PROTO
|
||||
#ifdef __cplusplus
|
||||
#define _PROTO(x) x
|
||||
#else
|
||||
#define _PROTO(x) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <setjmp.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
|
@ -67,24 +59,23 @@ struct lwpSem {
|
|||
|
||||
#define LWP_MAX_PRIO 8
|
||||
|
||||
struct lwpProc *lwpInitSystem _PROTO((int));
|
||||
struct lwpProc *lwpCreate
|
||||
_PROTO((int, void (*)(), int, int, char **, void *));
|
||||
void lwpExit _PROTO((void));
|
||||
void lwpTerminate _PROTO((struct lwpProc *));
|
||||
void lwpYield _PROTO((void));
|
||||
void lwpSleepFd _PROTO((int fd, int flags));
|
||||
void lwpSleepUntil _PROTO((long until));
|
||||
void lwpWakeupFd _PROTO((struct lwpProc *));
|
||||
void *lwpGetUD _PROTO((struct lwpProc *));
|
||||
void lwpSetUD _PROTO((struct lwpProc *, char *));
|
||||
int lwpSetPriority _PROTO((int));
|
||||
void lwpReschedule _PROTO(());
|
||||
struct lwpProc *lwpInitSystem(int);
|
||||
struct lwpProc *lwpCreate(int, void (*)(void *), int, int, char **, void *);
|
||||
void lwpExit(void);
|
||||
void lwpTerminate(struct lwpProc *);
|
||||
void lwpYield(void);
|
||||
void lwpSleepFd(int fd, int flags);
|
||||
void lwpSleepUntil(long until);
|
||||
void lwpWakeupFd(struct lwpProc *);
|
||||
void *lwpGetUD(struct lwpProc *);
|
||||
void lwpSetUD(struct lwpProc *, char *);
|
||||
int lwpSetPriority(int);
|
||||
void lwpReschedule();
|
||||
|
||||
struct lwpSem *lwpCreateSem _PROTO((int));
|
||||
void lwpSignal _PROTO((struct lwpSem *));
|
||||
void lwpWait _PROTO((struct lwpSem *));
|
||||
void lwpSelect _PROTO((int argc, char **argv));
|
||||
struct lwpSem *lwpCreateSem(int);
|
||||
void lwpSignal(struct lwpSem *);
|
||||
void lwpWait(struct lwpSem *);
|
||||
void lwpSelect(int argc, char **argv);
|
||||
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
|
||||
|
|
|
@ -27,8 +27,7 @@
|
|||
#if defined(_EMPTH_LWP)
|
||||
|
||||
struct lwpProc *
|
||||
lwpGetFirst(q)
|
||||
struct lwpQueue *q;
|
||||
lwpGetFirst(struct lwpQueue *q)
|
||||
{
|
||||
struct lwpProc *head;
|
||||
|
||||
|
@ -38,9 +37,7 @@ struct lwpQueue *q;
|
|||
}
|
||||
|
||||
void
|
||||
lwpAddTail(q, p)
|
||||
register struct lwpQueue *q;
|
||||
register struct lwpProc *p;
|
||||
lwpAddTail(register struct lwpQueue *q, register struct lwpProc *p)
|
||||
{
|
||||
if (!q->tail)
|
||||
q->head = p;
|
||||
|
|
|
@ -62,8 +62,7 @@ struct lwpSelect {
|
|||
struct lwpSelect LwpSelect;
|
||||
|
||||
void
|
||||
lwpInitSelect(proc)
|
||||
struct lwpProc *proc;
|
||||
lwpInitSelect(struct lwpProc *proc)
|
||||
{
|
||||
LwpSelect.maxfd = 0;
|
||||
LwpSelect.nfds = 0;
|
||||
|
@ -82,9 +81,7 @@ struct lwpProc *proc;
|
|||
}
|
||||
|
||||
void
|
||||
lwpSleepFd(fd, mask)
|
||||
int fd;
|
||||
int mask;
|
||||
lwpSleepFd(int fd, int mask)
|
||||
{
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
|
||||
|
@ -116,8 +113,7 @@ int mask;
|
|||
}
|
||||
|
||||
void
|
||||
lwpWakeupFd(proc)
|
||||
struct lwpProc *proc;
|
||||
lwpWakeupFd(struct lwpProc *proc)
|
||||
{
|
||||
if (proc->fd < 0)
|
||||
return;
|
||||
|
@ -132,8 +128,7 @@ struct lwpProc *proc;
|
|||
}
|
||||
|
||||
void
|
||||
lwpSleepUntil(until)
|
||||
long until;
|
||||
lwpSleepUntil(long int until)
|
||||
{
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
|
||||
|
@ -149,9 +144,7 @@ long until;
|
|||
|
||||
/*ARGSUSED*/
|
||||
void
|
||||
lwpSelect(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
lwpSelect(void *arg)
|
||||
{
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
struct lwpProc *us = LwpCurrent;
|
||||
|
|
|
@ -38,9 +38,7 @@ extern char *strdup();
|
|||
* create a lwpSemaphore.
|
||||
*/
|
||||
struct lwpSem *
|
||||
lwpCreateSem(name, count)
|
||||
char *name;
|
||||
int count;
|
||||
lwpCreateSem(char *name, int count)
|
||||
{
|
||||
struct lwpSem *new;
|
||||
|
||||
|
@ -57,8 +55,7 @@ int count;
|
|||
* the blocked process has a higher priority than ours'.
|
||||
*/
|
||||
void
|
||||
lwpSignal(s)
|
||||
struct lwpSem *s;
|
||||
lwpSignal(struct lwpSem *s)
|
||||
{
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
|
||||
|
@ -78,8 +75,7 @@ struct lwpSem *s;
|
|||
* wait on a lwpSemaphore
|
||||
*/
|
||||
void
|
||||
lwpWait(s)
|
||||
struct lwpSem *s;
|
||||
lwpWait(struct lwpSem *s)
|
||||
{
|
||||
extern struct lwpProc *LwpCurrent;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue