summaryrefslogtreecommitdiff
path: root/event-internal.h
diff options
context:
space:
mode:
authorChristopher Davis <chrisd@torproject.org>2010-08-17 05:02:00 -0700
committerChristopher Davis <chrisd@torproject.org>2010-09-08 01:22:22 -0700
commit76f7e7ae745ad730795f0a4a3bc1299a00137cc2 (patch)
tree5327da1a718cc561e989fee28af0bbafc2e2ee92 /event-internal.h
parentd844242f9b138be4896942ded25d74a91bf29901 (diff)
downloadlibevent-76f7e7ae745ad730795f0a4a3bc1299a00137cc2.tar.gz
Some IOCP bufferevent tweaks.
- Increment reference count of bufferevents before initiating overlapped operations to prevent the destructor from being called while operations are pending. The only portable way of canceling overlapped ops is to close the socket. - Translate error codes to WSA* codes. - Better handling of errors. - Add an interface to add and del "virtual" events. Because IOCP bufferevents don't register any events with the base, the event loop has no way of knowing they exist. This causes the loop to terminate prematurely. event_base_{add,del}_virtual increment/decrement base's event count so the loop runs while there are any enabled IOCP bufferevents.
Diffstat (limited to 'event-internal.h')
-rw-r--r--event-internal.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/event-internal.h b/event-internal.h
index e52c129b..7d97d98e 100644
--- a/event-internal.h
+++ b/event-internal.h
@@ -182,6 +182,8 @@ struct event_base {
/** Data to implement the common signal handelr code. */
struct evsig_info sig;
+ /** Number of virtual events */
+ int virtual_event_count;
/** Number of total events added to this event_base */
int event_count;
/** Number of total events active in this event_base */
@@ -313,6 +315,10 @@ int _evsig_restore_handler(struct event_base *base, int evsignal);
void event_active_nolock(struct event *ev, int res, short count);
+/* FIXME document. */
+void event_base_add_virtual(struct event_base *base);
+void event_base_del_virtual(struct event_base *base);
+
#ifdef __cplusplus
}
#endif