summaryrefslogtreecommitdiff
path: root/otk/timerqueuemanager.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-01-14 21:14:21 +0000
committerDana Jansens <danakj@orodu.net>2003-01-14 21:14:21 +0000
commit231f4dadabd532183317188c1a0e8ffe87dc579b (patch)
tree31cc8261b5bdc890588aa2c8e7f418b91d8cf095 /otk/timerqueuemanager.cc
parenta388c41df485e6ac7cfb26231b7ac6be76e3522e (diff)
no long used with our Timer-ng!
Diffstat (limited to 'otk/timerqueuemanager.cc')
-rw-r--r--otk/timerqueuemanager.cc68
1 files changed, 0 insertions, 68 deletions
diff --git a/otk/timerqueuemanager.cc b/otk/timerqueuemanager.cc
deleted file mode 100644
index e5f0a741..00000000
--- a/otk/timerqueuemanager.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
-
-#ifdef HAVE_CONFIG_H
-# include "../config.h"
-#endif // HAVE_CONFIG_H
-
-#include "timerqueuemanager.hh"
-#include "display.hh"
-
-namespace otk {
-
-void TimerQueueManager::fire(bool wait)
-{
- fd_set rfds;
- timeval now, tm, *timeout = (timeval *) 0;
-
- const int xfd = ConnectionNumber(**display);
-
- FD_ZERO(&rfds);
- FD_SET(xfd, &rfds); // break on any x events
-
- if (wait) {
- if (! timerList.empty()) {
- const Timer* const timer = timerList.top();
-
- gettimeofday(&now, 0);
- tm = timer->remainingTime(now);
-
- timeout = &tm;
- }
-
- select(xfd + 1, &rfds, 0, 0, timeout);
- }
-
- // check for timer timeout
- gettimeofday(&now, 0);
-
- // there is a small chance for deadlock here:
- // *IF* the timer list keeps getting refreshed *AND* the time between
- // timer->start() and timer->shouldFire() is within the timer's period
- // then the timer will keep firing. This should be VERY near impossible.
- while (! timerList.empty()) {
- Timer *timer = timerList.top();
- if (! timer->shouldFire(now))
- break;
-
- timerList.pop();
-
- timer->fire();
- if (timer->recurring())
- timer->start();
- }
-}
-
-
-void TimerQueueManager::addTimer(Timer *timer)
-{
- assert(timer);
- timerList.push(timer);
-}
-
-void TimerQueueManager::removeTimer(Timer* timer)
-{
- assert(timer);
- timerList.release(timer);
-}
-
-}