mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 09:26:30 +00:00
event: Refactor async event processing
- Improve the implementation of deferred/immediate events. - Use the new queue module to change how/when events are queued/processed by giving a private queue to each emitter. - Immediate events(which only exist to break uv_run recursion) are now represented in the `loop->fast_events` queue. - Events pushed to child queues are propagated to the event loop main queue and processed as K_EVENT keys.
This commit is contained in:
@@ -115,16 +115,6 @@ static void deadly_signal(int signum)
|
||||
static void on_signal(SignalWatcher *handle, int signum, void *data)
|
||||
{
|
||||
assert(signum >= 0);
|
||||
loop_push_event(&loop, (Event) {
|
||||
.handler = on_signal_event,
|
||||
.data = (void *)(uintptr_t)signum
|
||||
}, false);
|
||||
}
|
||||
|
||||
static void on_signal_event(Event event)
|
||||
{
|
||||
int signum = (int)(uintptr_t)event.data;
|
||||
|
||||
switch (signum) {
|
||||
#ifdef SIGPWR
|
||||
case SIGPWR:
|
||||
@@ -148,4 +138,3 @@ static void on_signal_event(Event event)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user