1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 18:45:10 +00:00

update system: clear multiple posts in case of slow updates

This commit is contained in:
Pavel Labath 2011-03-25 12:33:13 +01:00
parent b99c7291bc
commit 06304030a2

View File

@ -98,6 +98,11 @@ namespace conky {
sem_start.wait(); sem_start.wait();
if(done) if(done)
return; 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(); work();
if(wait) if(wait)
sem_wait.post(); sem_wait.post();