aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/event.h
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/event.h
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/event.h')
-rw-r--r--src/nvim/os/event.h35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/nvim/os/event.h b/src/nvim/os/event.h
deleted file mode 100644
index db02b38c7f..0000000000
--- a/src/nvim/os/event.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef NVIM_OS_EVENT_H
-#define NVIM_OS_EVENT_H
-
-#include <stdint.h>
-#include <stdbool.h>
-
-#include "nvim/os/event_defs.h"
-#include "nvim/os/job_defs.h"
-#include "nvim/os/time.h"
-
-// Poll for events until a condition or timeout
-#define event_poll_until(timeout, condition) \
- do { \
- int remaining = timeout; \
- uint64_t before = (remaining > 0) ? os_hrtime() : 0; \
- while (!(condition)) { \
- event_poll(remaining); \
- if (remaining == 0) { \
- break; \
- } else if (remaining > 0) { \
- uint64_t now = os_hrtime(); \
- remaining -= (int) ((now - before) / 1000000); \
- before = now; \
- if (remaining <= 0) { \
- break; \
- } \
- } \
- } \
- } while (0)
-
-#ifdef INCLUDE_GENERATED_DECLARATIONS
-# include "os/event.h.generated.h"
-#endif
-
-#endif // NVIM_OS_EVENT_H