]> git.pond.sub.org Git - empserver/commitdiff
Fix lwpReschedule()'s assertion "have runnable thread"
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 15 Jan 2010 21:06:51 +0000 (22:06 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 19 Jan 2010 07:40:42 +0000 (08:40 +0100)
If there is no runnable thread, we're deadlocked.  lwpReschedule() has
an assertion to catch this.  But it didn't work, and the code
following it would crash then.  Can't actually happen, because the
EventHandler thread is always runnable.  Spotted by the Clang Static
Analyzer.

src/lib/lwp/lwp.c

index 8189450ac2033efd971a74801f13cfca14fc880b..83bbe16902212da35f43cd382e3164715da4eca2 100644 (file)
@@ -103,7 +103,7 @@ lwpReschedule(void)
        if (nextp)
            break;
     }
-    if (CANT_HAPPEN(!LwpCurrent && !nextp))
+    if (CANT_HAPPEN(!nextp))
        abort();
     if (LwpCurrent != nextp) {
        struct lwpProc *oldp = LwpCurrent;