]> git.pond.sub.org Git - empserver/commitdiff
(lwpReschedule): Use CANT_HAPPEN() and abort() instead of lwpStatus()
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 1 May 2006 17:10:50 +0000 (17:10 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 1 May 2006 17:10:50 +0000 (17:10 +0000)
and exit() for fatal internal errors.

src/lib/lwp/lwp.c

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