This makes it easier to debug bugs.
void io_loop_notify_remove(struct io *io);
void io_loop_notify_handler_deinit(struct ioloop *ioloop);
+struct event *io_loop_get_active_global_root(void);
+
#endif
{
return timer->usecs;
}
+
+struct event *io_loop_get_active_global_root(void)
+{
+ if (current_ioloop == NULL)
+ return NULL;
+ if (current_ioloop->cur_ctx == NULL)
+ return NULL;
+ return current_ioloop->cur_ctx->root_global_event;
+}
#include "time-util.h"
#include "str.h"
#include "strescape.h"
-#include "ioloop.h"
+#include "ioloop-private.h"
enum event_code {
EVENT_CODE_ALWAYS_LOG_SOURCE = 'a',
{
i_assert(event != NULL);
i_assert(event == current_global_event);
+ /* If the active context's root event is popped, we'll assert-crash
+ later on when deactivating the context and the root event no longer
+ exists. */
+ i_assert(event != io_loop_get_active_global_root());
if (!array_is_created(&global_event_stack) ||
array_count(&global_event_stack) == 0)