From: Markus Armbruster Date: Fri, 15 Jan 2010 21:06:51 +0000 (+0100) Subject: Fix lwpReschedule()'s assertion "have runnable thread" X-Git-Tag: v4.3.24~14 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=6386583c1c55fd4dd70b8a820e50100bfce61fad;ds=sidebyside Fix lwpReschedule()'s assertion "have runnable thread" 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. --- diff --git a/src/lib/lwp/lwp.c b/src/lib/lwp/lwp.c index 8189450ac..83bbe1690 100644 --- a/src/lib/lwp/lwp.c +++ b/src/lib/lwp/lwp.c @@ -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;