#if defined(_EMPTH_LWP)
-#ifdef BOUNDS_CHECK
-#include <bounds/fix-args.h>
-#include <bounds/unchecked.h>
-#endif
-
struct lwpQueue LwpSchedQ[LWP_MAX_PRIO], LwpDeadQ;
struct lwpProc *LwpCurrent = NULL;
growsdown(void *x)
{
int y;
-
-#ifdef BOUNDS_CHECK
- BOUNDS_CHECKING_OFF;
-#endif
y = (x > (void *)&y);
-
-#ifdef BOUNDS_CHECK
- BOUNDS_CHECKING_ON;
-#endif
-
return y;
}
lwpAddTail(&LwpDeadQ, nextp);
} else {
lwpDestroy(nextp);
-/* fprintf(stderr, "Destroying done\n"); */
}
nextp = 0;
}
if (LwpCurrent)
lwpStatus(LwpCurrent, "switch out");
/* do context switch */
-#ifdef BOUNDS_CHECK
- BOUNDS_CHECKING_OFF;
-#endif
-
- i = lwpSave(LwpCurrent->context);
-#ifdef BOUNDS_CHECK
- BOUNDS_CHECKING_ON;
-#endif
-
- if (LwpCurrent != nextp && !(LwpCurrent && i)) {
+ if (LwpCurrent != nextp && !(LwpCurrent && lwpSave(LwpCurrent->context))) {
/* restore previous context */
lwpStatus(nextp, "switch in %d", nextp->pri);
LwpCurrent = nextp;
*LwpContextPtr = LwpCurrent->ud;
-#ifdef BOUNDS_CHECK
- BOUNDS_CHECKING_OFF;
-#endif
lwpRestore(LwpCurrent->context);
-
-#ifdef BOUNDS_CHECK
- BOUNDS_CHECKING_ON;
-#endif
}
}
{
sigset_t set;
-#ifdef BOUNDS_CHECK
- BOUNDS_CHECKING_OFF;
-#endif
sigemptyset(&set);
sigaddset(&set, SIGALRM);
sigprocmask(SIG_SETMASK, &set, &oldmask);
lwpStatus(LwpCurrent, "starting at entry point");
(*LwpCurrent->entry)(LwpCurrent->ud);
lwpExit();
-#ifdef BOUNDS_CHECK
- BOUNDS_CHECKING_ON;
-#endif
-
-
}
/*