Have a way to wait until a worker state changes.
[apps/madmutt.git] / lib-sys / evtloop.h
index 73c9ec5..bb7c50e 100644 (file)
@@ -15,7 +15,7 @@
  *  MA 02110-1301, USA.
  */
 /*
- *  Copyright © 2006 Pierre Habouzit
+ *  Copyright © 2007 Pierre Habouzit
  */
 
 #ifndef MUTT_LIB_SYS_EVTLOOP_H
@@ -58,13 +58,15 @@ typedef struct job_t {
     int fd;
     int ssf;
 
-    gnutls_session_t session;
-    gnutls_certificate_credentials_t xcred;
-
+    unsigned cond  : 1;
     el_state state : 2;
     el_mode  mode  : 3;
     el_mode  emode : 3;
 
+    gnutls_session_t session;
+    gnutls_certificate_credentials_t xcred;
+
+    struct timeval mru;
     int (*llp)(struct job_t *);
     const struct machine_t *m;
     void *ptr;
@@ -94,8 +96,12 @@ __must_check__ int el_job_starttls(job_t *w);
 __must_check__ ssize_t el_job_read(job_t *w, buffer_t *buf);
 __must_check__ ssize_t el_job_write(job_t *w, buffer_t *buf);
 
+void el_lock(void);
+void el_unlock(void);
+void el_wait(job_t *w);
 
 int el_dispatch(int timeout);
+
 void el_initialize(void);
 void el_shutdown(void);