aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/event/loop.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-08-28 01:56:02 +0200
committerGitHub <noreply@github.com>2019-08-28 01:56:02 +0200
commit82d52b229df711b710862ce772603ea55113a32e (patch)
treec097dd598d961b9090a682cf8267ca615d42b592 /src/nvim/event/loop.c
parent3c9c64d9dd486598f36c597da1eaffebb3bf4cef (diff)
parent3157baed83b7e94f2ff92e6fd97e85dab41a1c94 (diff)
downloadrneovim-82d52b229df711b710862ce772603ea55113a32e.tar.gz
rneovim-82d52b229df711b710862ce772603ea55113a32e.tar.bz2
rneovim-82d52b229df711b710862ce772603ea55113a32e.zip
Merge #4448 'paste: redesign'
fix #3447 fix #3566 fix #7066 fix #7212 fix #7273 fix #7455 fix #10415 NA vim-patches: vim-patch:8.1.1198 vim-patch:8.1.0224 vim-patch:8.0.1299 vim-patch:8.0.0569 vim-patch:8.0.0303 vim-patch:8.0.0296 vim-patch:8.0.0244 vim-patch:8.0.0238 vim-patch:8.0.0232 vim-patch:8.0.0231 vim-patch:8.0.0230 vim-patch:8.0.0210
Diffstat (limited to 'src/nvim/event/loop.c')
-rw-r--r--src/nvim/event/loop.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/nvim/event/loop.c b/src/nvim/event/loop.c
index 609c723c57..529ddd8eba 100644
--- a/src/nvim/event/loop.c
+++ b/src/nvim/event/loop.c
@@ -36,6 +36,10 @@ void loop_init(Loop *loop, void *data)
/// Processes all `Loop.fast_events` events.
/// Does NOT process `Loop.events`, that is an application-specific decision.
///
+/// @param loop
+/// @param ms 0: non-blocking poll.
+/// >0: timeout after `ms`.
+/// <0: wait forever.
/// @returns true if `ms` timeout was reached
bool loop_poll_events(Loop *loop, int ms)
{
@@ -104,10 +108,10 @@ static void loop_deferred_event(void **argv)
void loop_on_put(MultiQueue *queue, void *data)
{
Loop *loop = data;
- // Sometimes libuv will run pending callbacks(timer for example) before
+ // Sometimes libuv will run pending callbacks (timer for example) before
// blocking for a poll. If this happens and the callback pushes a event to one
// of the queues, the event would only be processed after the poll
- // returns(user hits a key for example). To avoid this scenario, we call
+ // returns (user hits a key for example). To avoid this scenario, we call
// uv_stop when a event is enqueued.
uv_stop(&loop->uv);
}
@@ -158,10 +162,15 @@ size_t loop_size(Loop *loop)
return rv;
}
+void loop_dummy_event(void **argv)
+{
+}
+
static void async_cb(uv_async_t *handle)
{
Loop *l = handle->loop->data;
uv_mutex_lock(&l->mutex);
+ // Flush thread_events to fast_events for processing on main loop.
while (!multiqueue_empty(l->thread_events)) {
Event ev = multiqueue_get(l->thread_events);
multiqueue_put_event(l->fast_events, ev);