]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/mainloop.h
UCW::CGI: Bug fixes
[libucw.git] / ucw / mainloop.h
index 5bd042091a07bf95d929aab4a2fae7f2fcbbb495..0bf4e2edfadc10ea4577ecd41b8bf22470db0c7a 100644 (file)
@@ -34,7 +34,8 @@
 
 extern timestamp_t main_now;                   /** Current time in milliseconds since the UNIX epoch. See @main_get_time(). **/
 extern ucw_time_t main_now_seconds;            /** Current time in seconds since the epoch. **/
 
 extern timestamp_t main_now;                   /** Current time in milliseconds since the UNIX epoch. See @main_get_time(). **/
 extern ucw_time_t main_now_seconds;            /** Current time in seconds since the epoch. **/
-extern clist main_timer_list, main_file_list, main_hook_list, main_process_list;
+extern timestamp_t main_idle_time;             /** Total time in milliseconds spent in the poll() call. **/
+extern clist main_file_list, main_hook_list, main_hook_done_list, main_process_list;
 
 /**
  * This is a description of a timer.
 
 /**
  * This is a description of a timer.
@@ -47,6 +48,7 @@ extern clist main_timer_list, main_file_list, main_hook_list, main_process_list;
 struct main_timer {
   cnode n;
   timestamp_t expires;
 struct main_timer {
   cnode n;
   timestamp_t expires;
+  uns index;
   void (*handler)(struct main_timer *tm);      /* [*] Function to be called when the timer expires. */
   void *data;                                  /* [*] Data for use by the handler */
 };
   void (*handler)(struct main_timer *tm);      /* [*] Function to be called when the timer expires. */
   void *data;                                  /* [*] Data for use by the handler */
 };
@@ -259,6 +261,7 @@ enum main_hook_return {
 
 /**
  * Inserts a new hook into the loop.
 
 /**
  * Inserts a new hook into the loop.
+ * The hook will be scheduled at least once before next sleep.
  * May be called from inside a hook handler too.
  **/
 void hook_add(struct main_hook *ho);
  * May be called from inside a hook handler too.
  **/
 void hook_add(struct main_hook *ho);