Fix infinite looping and crash problem.
[asterisk/asterisk.git] / main / threadpool.c
index 1b04779..5ed9a42 100644 (file)
@@ -784,7 +784,7 @@ static void worker_active(struct worker_thread *worker)
 {
        int alive = 1;
        while (alive) {
-               if (threadpool_execute(worker->pool)) {
+               if (threadpool_execute(worker->pool) == 0) {
                        alive = worker_idle(worker);
                }
        }