mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 08:28:34 +00:00
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.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#include <uv.h>
|
||||
|
||||
#include "nvim/os/time.h"
|
||||
#include "nvim/os/event.h"
|
||||
#include "nvim/event/loop.h"
|
||||
#include "nvim/vim.h"
|
||||
|
||||
static uv_mutex_t delay_mutex;
|
||||
@@ -43,7 +43,7 @@ void os_delay(uint64_t milliseconds, bool ignoreinput)
|
||||
if (milliseconds > INT_MAX) {
|
||||
milliseconds = INT_MAX;
|
||||
}
|
||||
event_poll_until((int)milliseconds, got_int);
|
||||
LOOP_POLL_EVENTS_UNTIL(&loop, (int)milliseconds, got_int);
|
||||
} else {
|
||||
os_microdelay(milliseconds * 1000);
|
||||
}
|
||||
|
Reference in New Issue
Block a user