26 #include <core/threading/thread.h> 27 #include <utils/time/clock.h> 28 #include <utils/time/time.h> 29 #include <utils/time/wait.h> 30 #include <utils/system/signal.h> 45 __clock = Clock::instance();
52 __clock->get_time(__until);
53 *__until += (
long int)30000;
59 printf(
"Now at %p\n", &now);
60 __clock->get_time(&now);
62 long int remaining_usec = (*__until - now).in_usec();
63 while ( remaining_usec > 0 ) {
64 usleep(remaining_usec);
65 __clock->get_time(&now);
66 remaining_usec = (*__until - now).in_usec();
78 QaSignalHandler(
Thread *thread)
80 this->thread = thread;
83 virtual void handle_signal(
int signum)
91 class QaTestThread :
public Thread 94 QaTestThread() :
Thread(
"QaTestThread")
96 timewait =
new TimeWait(Clock::instance(), 30000);
97 testwait =
new QaTestWait();
102 printf(
"Loop running\n");
103 timewait->mark_start();
109 QaTestWait *testwait;
113 int main(
int argc,
char** argv)
118 QaSignalHandler h(&t);
119 SignalManager::register_handler(SIGINT, &h);
Fawkes library namespace.
This is supposed to be the central clock in Fawkes.
Interface for signal handling.
A class for handling time.
Thread class encapsulation of pthreads.