aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/pipe_process.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-07-16 23:10:04 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-07-17 00:19:19 -0300
commit991d3ec1e679bb6407f2a5820910d2968424183c (patch)
tree38810fb657e1e1ea9d77b7a7963e874e8bda99d1 /src/nvim/os/pipe_process.c
parent9e42ef4e1312fb6888d2691e9d979b95dd43ec94 (diff)
downloadrneovim-991d3ec1e679bb6407f2a5820910d2968424183c.tar.gz
rneovim-991d3ec1e679bb6407f2a5820910d2968424183c.tar.bz2
rneovim-991d3ec1e679bb6407f2a5820910d2968424183c.zip
event loop: New abstraction layer with refactored time/signal API
- Add event loop abstraction module under src/nvim/event. The src/nvim/event/loop module replaces src/nvim/os/event - Remove direct dependency on libuv signal/timer API and use the new abstraction instead. - Replace all references to uv_default_loop() by &loop.uv, a new global variable that wraps libuv main event loop but allows the event loop functions to be reused in other contexts.
Diffstat (limited to 'src/nvim/os/pipe_process.c')
-rw-r--r--src/nvim/os/pipe_process.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/nvim/os/pipe_process.c b/src/nvim/os/pipe_process.c
index 2ac305e967..9980cf7c56 100644
--- a/src/nvim/os/pipe_process.c
+++ b/src/nvim/os/pipe_process.c
@@ -9,6 +9,8 @@
#include "nvim/os/job_private.h"
#include "nvim/os/pipe_process.h"
#include "nvim/memory.h"
+#include "nvim/vim.h"
+#include "nvim/globals.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "os/pipe_process.c.generated.h"
@@ -46,19 +48,19 @@ void pipe_process_init(Job *job)
handle_set_job((uv_handle_t *)&pipeproc->proc, job);
if (job->opts.writable) {
- uv_pipe_init(uv_default_loop(), &pipeproc->proc_stdin, 0);
+ uv_pipe_init(&loop.uv, &pipeproc->proc_stdin, 0);
pipeproc->stdio[0].flags = UV_CREATE_PIPE | UV_READABLE_PIPE;
pipeproc->stdio[0].data.stream = (uv_stream_t *)&pipeproc->proc_stdin;
}
if (job->opts.stdout_cb) {
- uv_pipe_init(uv_default_loop(), &pipeproc->proc_stdout, 0);
+ uv_pipe_init(&loop.uv, &pipeproc->proc_stdout, 0);
pipeproc->stdio[1].flags = UV_CREATE_PIPE | UV_WRITABLE_PIPE;
pipeproc->stdio[1].data.stream = (uv_stream_t *)&pipeproc->proc_stdout;
}
if (job->opts.stderr_cb) {
- uv_pipe_init(uv_default_loop(), &pipeproc->proc_stderr, 0);
+ uv_pipe_init(&loop.uv, &pipeproc->proc_stderr, 0);
pipeproc->stdio[2].flags = UV_CREATE_PIPE | UV_WRITABLE_PIPE;
pipeproc->stdio[2].data.stream = (uv_stream_t *)&pipeproc->proc_stderr;
}
@@ -81,7 +83,7 @@ bool pipe_process_spawn(Job *job)
{
UvProcess *pipeproc = job->process;
- if (uv_spawn(uv_default_loop(), &pipeproc->proc, &pipeproc->proc_opts) != 0) {
+ if (uv_spawn(&loop.uv, &pipeproc->proc, &pipeproc->proc_opts) != 0) {
return false;
}