Socket: fixed bug in readfrom where socklen was not set
[senf.git] / Scheduler / Scheduler.hh
index 779e04b..62a687c 100644 (file)
@@ -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.