*** empty log message ***
authorpcg <pcg>
Sat, 17 Jan 2004 14:10:40 +0000 (14:10 +0000)
committerpcg <pcg>
Sat, 17 Jan 2004 14:10:40 +0000 (14:10 +0000)
src/iom.C
src/iom.h

index e4d86989d0a62788ad8c366c67a0556656371602..36097f35b824a8795966ff20a09002845594917c 100644 (file)
--- a/src/iom.C
+++ b/src/iom.C
 // TSTAMP_MAX must still fit into a positive struct timeval
 #define TSTAMP_MAX (double)(1UL<<31)
 
+// this is a dummy time watcher to ensure that the first
+// time watcher is _always_ valid, this gets rid of a lot
+// of null-pointer-checks
+// (must come _before_ iom is being defined)
+static struct tw0 : time_watcher {
+  void cb (time_watcher &w)
+  {
+    // should never get called
+    // reached end-of-time, or tstamp has a bogus definition,
+    // or compiler initilization order broken, or somethine else :)
+    abort ();
+  }
+
+  tw0()
+  : time_watcher (this, &tw0::cb)
+  { }
+} tw0;
+
 tstamp NOW;
 static bool iom_valid;
 io_manager iom;
@@ -224,22 +242,6 @@ void io_manager::loop ()
     }
 }
 
-// this is a dummy time watcher to ensure that the first
-// time watcher is _always_ valid, this gets rid of a lot
-// of null-pointer-checks
-static struct tw0 : time_watcher {
-  void cb (time_watcher &w)
-  {
-    // should never get called
-    // reached end-of-time, or tstamp has a bogus definition :)
-    abort ();
-  }
-
-  tw0()
-  : time_watcher (this, &tw0::cb)
-  { }
-} tw0;
-
 io_manager::io_manager ()
 {
   iom_valid = true;
@@ -248,6 +250,7 @@ io_manager::io_manager ()
   set_now ();
 
   tw0.start (TSTAMP_MAX);
+  printf ("abort, %f but inly on %f\n", NOW, tw0.at);
 #endif
 }
 
index d2efc4892727ea64e4e8be4db0668db8dcd8d787..f5fecb6bd9a5e753c2100ce643e49fa14c879351 100644 (file)
--- a/src/iom.h
+++ b/src/iom.h
@@ -158,7 +158,7 @@ struct time_watcher : watcher, callback1<void, time_watcher &> {
 
   template<class O1, class O2>
   time_watcher (O1 *object, void (O2::*method)(time_watcher &))
-  : callback1<void, time_watcher &>(object,method)
+  : callback1<void, time_watcher &>(object,method), at(0)
   { }
   ~time_watcher () { stop (); }
 };