From 06304030a23c9ae1cb6778f5a0b4b192ac719077 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Fri, 25 Mar 2011 12:33:13 +0100 Subject: [PATCH] update system: clear multiple posts in case of slow updates --- src/update-cb.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/update-cb.cc b/src/update-cb.cc index d86b8731..2ec20131 100644 --- a/src/update-cb.cc +++ b/src/update-cb.cc @@ -98,6 +98,11 @@ namespace conky { sem_start.wait(); if(done) return; + + // clear any remaining posts in case the previous iteration was very slow + // (this should only happen if wait == false) + while(sem_start.trywait()); + work(); if(wait) sem_wait.post();