From 920a5e69b0edf59ed5e7bd3b2cb040b6c8974611 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 26 Apr 2013 19:15:50 -0400 Subject: [PATCH] Clarify an important point about event_base_foreach_event() --- include/event2/event.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/event2/event.h b/include/event2/event.h index b946b008..82015365 100644 --- a/include/event2/event.h +++ b/include/event2/event.h @@ -1423,6 +1423,10 @@ typedef int (*event_base_foreach_event_cb)(const struct event_base *, const stru event_base_foreach_event() holds a lock on the event_base() for the whole time it's running: slow callbacks are not advisable. + Note that Libevent adds some events of its own to make pieces of its + functionality work. You must not assume that the only events you'll + encounter will be the ones you added yourself. + The callback function must return 0 to continue iteration, or some other integer to stop iterating. -- 2.40.0