26 #include <core/threading/thread.h> 27 #include <utils/system/signal.h> 28 #include <utils/time/clock.h> 29 #include <utils/time/time.h> 30 #include <utils/time/wait.h> 43 clock_ = Clock::instance();
50 clock_->get_time(until_);
51 *until_ += (
long int)30000;
58 printf(
"Now at %p\n", &now);
59 clock_->get_time(&now);
61 long int remaining_usec = (*until_ - now).in_usec();
62 while (remaining_usec > 0) {
63 usleep(remaining_usec);
64 clock_->get_time(&now);
65 remaining_usec = (*until_ - now).in_usec();
77 QaSignalHandler(
Thread *thread)
79 this->thread = thread;
83 handle_signal(
int signum)
91 class QaTestThread :
public Thread 94 QaTestThread() :
Thread(
"QaTestThread")
96 timewait =
new TimeWait(Clock::instance(), 30000);
97 testwait =
new QaTestWait();
103 printf(
"Loop running\n");
104 timewait->mark_start();
110 QaTestWait *testwait;
115 main(
int argc,
char **argv)
120 QaSignalHandler h(&t);
121 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.