X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Scheduler%2FScheduler.hh;h=62a687ce5f39cea447d7228642a5abff0069b5f8;hb=c45c112ae88196ea8da9c5a9efb0e167196744d2;hp=779e04bbfa48786183476a3407c008ddbfe7e312;hpb=7a4fb9b49e6eccd19a1ea48a31175245b6dadb61;p=senf.git diff --git a/Scheduler/Scheduler.hh b/Scheduler/Scheduler.hh index 779e04b..62a687c 100644 --- a/Scheduler/Scheduler.hh +++ b/Scheduler/Scheduler.hh @@ -233,7 +233,10 @@ namespace scheduler { \li a callback calls terminate() \li the run queue becomes empty. */ - void process(); + void process(); + + /** \brief \c true, if scheduler is running, \c false otherwise */ + bool running(); /** \brief Called by callbacks to terminate the main loop @@ -242,6 +245,13 @@ namespace scheduler { */ void terminate(); + /** \brief Immediately rescheduler + + Calling yield() will cause the scheduler to terminate the current queue run and immediately + rescheduler all pending tasks. + */ + void yield(); + /** \brief Return timestamp of last event This is the timestamp, the last event has been signaled. This is the real time at which the @@ -249,6 +259,15 @@ namespace scheduler { */ ClockService::clock_type eventTime(); + /** \brief Return (approximate) current time + + This call will return the current time as far as it is already known to the scheduler. If + the scheduler is running, this will return eventTime(), otherwise it will return + ClockService::now(). While the scheduler is running, this will reduce the number of system + calls. + */ + ClockService::clock_type now(); + /** \brief Set watchdog timeout to \a ms milliseconds. Setting the watchdog timeout to 0 will disable the watchdog.