// Copyright 2005, The Tanoshi development team // Assigned to public domain, Use as you wish withou restriction. #include #include #include #include #include class main_proc : public sigc::trackable { public: Tanoshi::Wakeup wakeup; Tanoshi::EventManager eventmanager; void run(); void wakeupcall_slot(); unsigned int time; }; void main_proc::run() { wakeup.setEventManager(&eventmanager); wakeup.start(); int pid = fork(); if(pid) { for(;;) { sleep(1); printf("waking up...\n"); wakeup.wakeup(); } } else { wakeup.wakeupCall.connect(sigc::mem_fun(this, &main_proc::wakeupcall_slot)); for(;;) { eventmanager.processEvent(); eventmanager.sleep(); } } } void main_proc::wakeupcall_slot() { printf("Woken up...\n"); } int main() { class main_proc test; test.run(); }