diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-09-25 11:05:27 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-01-14 11:05:54 -0500 |
commit | b2db3fb4627c8bd06489334f69b6d36d60fb418d (patch) | |
tree | 3bee765e610e678cb9aecef34ef0d171e4581362 /src/common/compat_threads.h | |
parent | 4abbf13f99dac9e15856dc4e458a8c9525acab4d (diff) | |
download | tor-b2db3fb4627c8bd06489334f69b6d36d60fb418d.tar.gz tor-b2db3fb4627c8bd06489334f69b6d36d60fb418d.zip |
Documentation for new workqueue and condition and locking stuff
Diffstat (limited to 'src/common/compat_threads.h')
-rw-r--r-- | src/common/compat_threads.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/common/compat_threads.h b/src/common/compat_threads.h index b053136c15..9070f13e80 100644 --- a/src/common/compat_threads.h +++ b/src/common/compat_threads.h @@ -82,15 +82,23 @@ int tor_cond_wait(tor_cond_t *cond, tor_mutex_t *mutex, void tor_cond_signal_one(tor_cond_t *cond); void tor_cond_signal_all(tor_cond_t *cond); -/** DOCDOC */ +/** Helper type used to manage waking up the main thread while it's in + * the libevent main loop. Used by the work queue code. */ typedef struct alert_sockets_s { - /*XXX needs a better name */ + /* XXXX This structure needs a better name. */ + /** Socket that the main thread should listen for EV_READ events on. + * Note that this socket may be a regular fd on a non-Windows platform. + */ tor_socket_t read_fd; + /** Socket to use when alerting the main thread. */ tor_socket_t write_fd; + /** Function to alert the main thread */ int (*alert_fn)(tor_socket_t write_fd); + /** Function to make the main thread no longer alerted. */ int (*drain_fn)(tor_socket_t read_fd); } alert_sockets_t; int alert_sockets_create(alert_sockets_t *socks_out); +void alert_sockets_close(alert_sockets_t *socks); #endif |