From 8c2f0f8cbdba04f3d2eb65e3ea98f809545f8e87 Mon Sep 17 00:00:00 2001 From: Damien Leone Date: Mon, 18 Jun 2018 16:24:28 -0700 Subject: [PATCH] os: Recompute whether any clients are ready after check_timers() If a driver calls AttendClient() from within a timer callback we need to re-compute the local 'are_ready' to prevent the attended client from waiting until WaitForSomething() times out. This is a fix similar to commit 9ed5b263. Signed-off-by: Damien Leone Reviewed-by: Keith Packard (cherry picked from commit f33cb4264387ed14a586ba080885b4d21e4aa48b) --- os/WaitFor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/os/WaitFor.c b/os/WaitFor.c index 7c7b1d2d4..dc33c1648 100644 --- a/os/WaitFor.c +++ b/os/WaitFor.c @@ -190,10 +190,11 @@ WaitForSomething(Bool are_ready) /* deal with any blocked jobs */ if (workQueue) { ProcessWorkQueue(); - are_ready = clients_are_ready(); } timeout = check_timers(); + are_ready = clients_are_ready(); + if (are_ready) timeout = 0;