ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/iom.C
(Generate patch)

Comparing gvpe/src/iom.C (file contents):
Revision 1.13 by pcg, Sat Jan 17 01:18:36 2004 UTC vs.
Revision 1.14 by pcg, Sat Jan 17 14:08:57 2004 UTC

27#include "iom.h" 27#include "iom.h"
28 28
29// TSTAMP_MAX must still fit into a positive struct timeval 29// TSTAMP_MAX must still fit into a positive struct timeval
30#define TSTAMP_MAX (double)(1UL<<31) 30#define TSTAMP_MAX (double)(1UL<<31)
31 31
32// this is a dummy time watcher to ensure that the first
33// time watcher is _always_ valid, this gets rid of a lot
34// of null-pointer-checks
35// (must come _before_ iom is being defined)
36static struct tw0 : time_watcher {
37 void cb (time_watcher &w)
38 {
39 // should never get called
40 // reached end-of-time, or tstamp has a bogus definition,
41 // or compiler initilization order broken, or somethine else :)
42 abort ();
43 }
44
45 tw0()
46 : time_watcher (this, &tw0::cb)
47 { }
48} tw0;
49
32tstamp NOW; 50tstamp NOW;
33static bool iom_valid; 51static bool iom_valid;
34io_manager iom; 52io_manager iom;
35 53
36template<class watcher> 54template<class watcher>
222 break; 240 break;
223#endif 241#endif
224 } 242 }
225} 243}
226 244
227// this is a dummy time watcher to ensure that the first
228// time watcher is _always_ valid, this gets rid of a lot
229// of null-pointer-checks
230static struct tw0 : time_watcher {
231 void cb (time_watcher &w)
232 {
233 // should never get called
234 // reached end-of-time, or tstamp has a bogus definition :)
235 abort ();
236 }
237
238 tw0()
239 : time_watcher (this, &tw0::cb)
240 { }
241} tw0;
242
243io_manager::io_manager () 245io_manager::io_manager ()
244{ 246{
245 iom_valid = true; 247 iom_valid = true;
246 248
247#if IOM_TIME 249#if IOM_TIME
248 set_now (); 250 set_now ();
249 251
250 tw0.start (TSTAMP_MAX); 252 tw0.start (TSTAMP_MAX);
253 printf ("abort, %f but inly on %f\n", NOW, tw0.at);
251#endif 254#endif
252} 255}
253 256
254io_manager::~io_manager () 257io_manager::~io_manager ()
255{ 258{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines