(lwpReschedule): Use CANT_HAPPEN() and abort() instead of lwpStatus()

and exit() for fatal internal errors.
This commit is contained in:
Markus Armbruster 2006-05-01 17:10:50 +00:00
parent 6d4d5f7abf
commit 87c3790169

View file

@ -90,10 +90,8 @@ lwpReschedule(void)
/* destroy dead threads */ /* destroy dead threads */
lwpStatus(LwpCurrent, "Cleaning dead queue"); lwpStatus(LwpCurrent, "Cleaning dead queue");
while (NULL != (nextp = lwpGetFirst(&LwpDeadQ))) { while (NULL != (nextp = lwpGetFirst(&LwpDeadQ))) {
if (nextp == LwpCurrent) { if (CANT_HAPPEN(nextp == LwpCurrent))
lwpStatus(nextp, "OOOPS, we are running already dead thread"); abort();
exit(1);
}
lwpDestroy(nextp); lwpDestroy(nextp);
lwpStatus(LwpCurrent, "Destroying done"); lwpStatus(LwpCurrent, "Destroying done");
} }
@ -115,10 +113,8 @@ lwpReschedule(void)
if (nextp) if (nextp)
break; break;
} }
if (LwpCurrent == 0 && nextp == 0) { if (CANT_HAPPEN(LwpCurrent == 0 && nextp == 0))
fprintf(stderr, "No processes to run!\n"); abort();
exit(1);
}
if (LwpCurrent != nextp) { if (LwpCurrent != nextp) {
struct lwpProc *oldp = LwpCurrent; struct lwpProc *oldp = LwpCurrent;
if (oldp) if (oldp)