summaryrefslogtreecommitdiff
path: root/evmap-internal.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-01-27 13:54:05 -0500
committerNick Mathewson <nickm@torproject.org>2012-01-27 13:54:05 -0500
commit272033efe575a9dc7ec6f123a96afba5c69ff1c6 (patch)
tree7e07815c85fb05823e377f2a45ba7e140d8293e5 /evmap-internal.h
parent4b7baec668732e215f5f3533f2f74ccfad09a8af (diff)
downloadlibevent-272033efe575a9dc7ec6f123a96afba5c69ff1c6.tar.gz
Make event_reinit() more robust and maintainable
Previously, event_reinit required a bunch of really dubious hacks, and violated a lot of abstraction barriers to mess around with lists of internal events and "pretend" to re-add them. The new (and fairly well commented!) implementation tries to be much smarter, by isolating the changes as much as possible to the backend state, and minimizing the amount of abstraction violations. Specifically, we now use event_del() to remove events we want to remove, rather than futzing around with queues in event_reinit(). To avoid bogus calls to evsel->del(), we temporarily replace evsel with a null-object stub. Also, we now push the responsibility for calling evsel->add() down into the evmap code, so that we don't actually need to unlink and re-link all of our events.
Diffstat (limited to 'evmap-internal.h')
-rw-r--r--evmap-internal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/evmap-internal.h b/evmap-internal.h
index 8bf655fd..64269545 100644
--- a/evmap-internal.h
+++ b/evmap-internal.h
@@ -87,6 +87,9 @@ void evmap_signal_active(struct event_base *base, evutil_socket_t signum, int nc
void *evmap_io_get_fdinfo(struct event_io_map *ctx, evutil_socket_t fd);
+int evmap_io_reinit(struct event_base *base);
+int evmap_signal_reinit(struct event_base *base);
+
void evmap_check_integrity(struct event_base *base);
#endif /* _EVMAP_H_ */