diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-07-16 23:10:04 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-07-17 00:19:19 -0300 |
commit | 991d3ec1e679bb6407f2a5820910d2968424183c (patch) | |
tree | 38810fb657e1e1ea9d77b7a7963e874e8bda99d1 /src/nvim/os/rstream.c | |
parent | 9e42ef4e1312fb6888d2691e9d979b95dd43ec94 (diff) | |
download | rneovim-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/rstream.c')
-rw-r--r-- | src/nvim/os/rstream.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/os/rstream.c b/src/nvim/os/rstream.c index af84288f0f..dd91c2777e 100644 --- a/src/nvim/os/rstream.c +++ b/src/nvim/os/rstream.c @@ -120,7 +120,7 @@ void rstream_set_file(RStream *rstream, uv_file file) // in chunks of rstream->buffer_size, giving time for other events to // be processed between reads. rstream->fread_idle = xmalloc(sizeof(uv_idle_t)); - uv_idle_init(uv_default_loop(), rstream->fread_idle); + uv_idle_init(&loop.uv, rstream->fread_idle); rstream->fread_idle->data = NULL; handle_set_rstream((uv_handle_t *)rstream->fread_idle, rstream); } else { @@ -128,7 +128,7 @@ void rstream_set_file(RStream *rstream, uv_file file) assert(rstream->file_type == UV_NAMED_PIPE || rstream->file_type == UV_TTY); rstream->stream = xmalloc(sizeof(uv_pipe_t)); - uv_pipe_init(uv_default_loop(), (uv_pipe_t *)rstream->stream, 0); + uv_pipe_init(&loop.uv, (uv_pipe_t *)rstream->stream, 0); uv_pipe_open((uv_pipe_t *)rstream->stream, file); rstream->stream->data = NULL; handle_set_rstream((uv_handle_t *)rstream->stream, rstream); @@ -224,7 +224,7 @@ static void fread_idle_cb(uv_idle_t *handle) // Synchronous read uv_fs_read( - uv_default_loop(), + &loop.uv, &req, rstream->fd, &rstream->uvbuf, |