aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/event/loop.h
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-09-01 10:11:55 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-09-06 09:18:53 -0300
commitc20b802511a3d0e3b2277186a545c7f9f687410c (patch)
tree7118c3a32883bd831f234d1d1df205871e0fba97 /src/nvim/event/loop.h
parent203a4d5650ced506ae82ed6c79bd056a547f28c6 (diff)
downloadrneovim-c20b802511a3d0e3b2277186a545c7f9f687410c.tar.gz
rneovim-c20b802511a3d0e3b2277186a545c7f9f687410c.tar.bz2
rneovim-c20b802511a3d0e3b2277186a545c7f9f687410c.zip
loop: Improvements for thread-safety
- Implement `loop_schedule` method for queueing events from other threads - Make `loop_poll_events` `recursive` static variable a field of the Loop structure
Diffstat (limited to 'src/nvim/event/loop.h')
-rw-r--r--src/nvim/event/loop.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/event/loop.h b/src/nvim/event/loop.h
index 9212a45aa4..0c1fcb5ed9 100644
--- a/src/nvim/event/loop.h
+++ b/src/nvim/event/loop.h
@@ -16,11 +16,14 @@ KLIST_INIT(WatcherPtr, WatcherPtr, _noop)
typedef struct loop {
uv_loop_t uv;
- Queue *events, *fast_events;
+ Queue *events, *fast_events, *thread_events;
klist_t(WatcherPtr) *children;
uv_signal_t children_watcher;
uv_timer_t children_kill_timer, poll_timer;
size_t children_stop_requests;
+ uv_async_t async;
+ uv_mutex_t mutex;
+ int recursive;
} Loop;
#define CREATE_EVENT(queue, handler, argc, ...) \