diff options
Diffstat (limited to 'src/nvim/event/time.c')
-rw-r--r-- | src/nvim/event/time.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/nvim/event/time.c b/src/nvim/event/time.c index f68a66345f..b7e30e392b 100644 --- a/src/nvim/event/time.c +++ b/src/nvim/event/time.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include <stdint.h> #include <uv.h> @@ -51,17 +54,24 @@ static void time_watcher_cb(uv_timer_t *handle) FUNC_ATTR_NONNULL_ALL { TimeWatcher *watcher = handle->data; - if (watcher->blockable && !queue_empty(watcher->events)) { + if (watcher->blockable && !multiqueue_empty(watcher->events)) { // the timer blocked and there already is an unprocessed event waiting return; } CREATE_EVENT(watcher->events, time_event, 1, watcher); } +static void close_event(void **argv) +{ + TimeWatcher *watcher = argv[0]; + watcher->close_cb(watcher, watcher->data); +} + static void close_cb(uv_handle_t *handle) + FUNC_ATTR_NONNULL_ALL { TimeWatcher *watcher = handle->data; if (watcher->close_cb) { - watcher->close_cb(watcher, watcher->data); + CREATE_EVENT(watcher->events, close_event, 1, watcher); } } |