Mercurial > dovecot > core-2.2
changeset 21451:ef07cc84cbb3
lib: io_loop_set_current() - do nothing if ioloop doesn't change
There's no need to call the switch callbacks if the ioloop doesn't change.
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Fri, 27 Jan 2017 21:36:14 +0200 |
parents | 5ca3a3f11254 |
children | 39b8bb2d67bb |
files | src/lib/ioloop.c |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/ioloop.c Fri Jan 27 13:56:30 2017 +0200 +++ b/src/lib/ioloop.c Fri Jan 27 21:36:14 2017 +0200 @@ -779,6 +779,9 @@ io_switch_callback_t *const *callbackp; struct ioloop *prev_ioloop = current_ioloop; + if (ioloop == current_ioloop) + return; + current_ioloop = ioloop; if (array_is_created(&io_switch_callbacks)) { array_foreach(&io_switch_callbacks, callbackp)