X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=otk%2Ftimerqueuemanager.cc;h=793351543d8e33a4e2c9775be19c0993ab187cd3;hb=e2bf543333b69f0d32aa02782dbc971016f70cb0;hp=a37fe94dbca4827e8ccff7aed72f4f090cea140e;hpb=1d897f432e54400cb2a0e1499712782b336fd728;p=chaz%2Fopenbox diff --git a/otk/timerqueuemanager.cc b/otk/timerqueuemanager.cc index a37fe94d..79335154 100644 --- a/otk/timerqueuemanager.cc +++ b/otk/timerqueuemanager.cc @@ -9,7 +9,7 @@ namespace otk { -void OBTimerQueueManager::fire() +void OBTimerQueueManager::fire(bool wait) { fd_set rfds; timeval now, tm, *timeout = (timeval *) 0; @@ -19,17 +19,19 @@ void OBTimerQueueManager::fire() FD_ZERO(&rfds); FD_SET(xfd, &rfds); // break on any x events - if (! timerList.empty()) { - const OBTimer* const timer = timerList.top(); - - gettimeofday(&now, 0); - tm = timer->remainingTime(now); - - timeout = &tm; + if (wait) { + if (! timerList.empty()) { + const OBTimer* const timer = timerList.top(); + + gettimeofday(&now, 0); + tm = timer->remainingTime(now); + + timeout = &tm; + } + + select(xfd + 1, &rfds, 0, 0, timeout); } - select(xfd + 1, &rfds, 0, 0, timeout); - // check for timer timeout gettimeofday(&now, 0);