From 7446aaf9cf5e918a1750ccba4d1e76dc7e4fe44b Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 12 Dec 2017 00:50:36 +0200 Subject: [PATCH] lib: Move io_loop_context_[de]activate() to be public --- src/lib/ioloop-private.h | 3 --- src/lib/ioloop.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/lib/ioloop-private.h b/src/lib/ioloop-private.h index 35845338a5..1a49ae9c89 100644 --- a/src/lib/ioloop-private.h +++ b/src/lib/ioloop-private.h @@ -118,7 +118,4 @@ void io_loop_handler_deinit(struct ioloop *ioloop); void io_loop_notify_remove(struct io *io); void io_loop_notify_handler_deinit(struct ioloop *ioloop); -void io_loop_context_activate(struct ioloop_context *ctx); -void io_loop_context_deactivate(struct ioloop_context *ctx); - #endif diff --git a/src/lib/ioloop.h b/src/lib/ioloop.h index 7c3c38e332..853b470cb0 100644 --- a/src/lib/ioloop.h +++ b/src/lib/ioloop.h @@ -175,6 +175,17 @@ void io_loop_context_remove_callbacks(struct ioloop_context *ctx, /* Returns the current context set to ioloop. */ struct ioloop_context *io_loop_get_current_context(struct ioloop *ioloop); +/* Explicitly activate an ioloop context. There must not be any context active + at the moment, so this most likely shouldn't be called while ioloop is + running. An activated context must be explicitly deactivated with + io_loop_context_deactivate() before the ioloop is destroyed, or before + any ioloop is run. */ +void io_loop_context_activate(struct ioloop_context *ctx); +/* Explicitly deactivate an ioloop context. The given context must be currently + active or it assert-crashes. This should be called only after a context + was explicitly activated with io_loop_context_activate(). */ +void io_loop_context_deactivate(struct ioloop_context *ctx); + /* Returns fd, which contains all of the ioloop's current notifications. When it becomes readable, there is a new notification. Calling this function stops the existing notifications in the ioloop from working anymore. -- 2.47.3