(lwpReschedule): Use CANT_HAPPEN() and abort() instead of lwpStatus()
and exit() for fatal internal errors.
This commit is contained in:
parent
6d4d5f7abf
commit
87c3790169
1 changed files with 4 additions and 8 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue