]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Move io_loop_context_[de]activate() to be public
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 11 Dec 2017 22:50:36 +0000 (00:50 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 13 Dec 2017 11:04:26 +0000 (13:04 +0200)
src/lib/ioloop-private.h
src/lib/ioloop.h

index 35845338a50c09ba09972abc3d5976018e194a4b..1a49ae9c89be02034532978ef1ec60a54f0a25bf 100644 (file)
@@ -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
index 7c3c38e332db263fef4d0b2e74836ca774184e8a..853b470cb0b448a33ca3d83ed9ff2bd02a99f6e4 100644 (file)
@@ -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.