LibCore: Expose register_process and implement for Windows event loop

This is the closest Windows equivalent to integrating process exit
handlers into the event loop.

Linux could also integrate register_process() into the poll() based
Unix event loop via the SYS_pidfd_open syscall; however, macOS requires
a kqueue. So for now register_process will only be used by Windows to
implement WebView::ProcessMonitor.

Co-authored-by: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
This commit is contained in:
ayeteadoe
2025-11-22 15:02:26 -08:00
committed by Alexander Kalenik
parent 433ff624b8
commit 4cb7743915
Notes: github-actions[bot] 2026-04-12 14:09:25 +00:00
5 changed files with 95 additions and 0 deletions

View File

@@ -88,6 +88,10 @@ public:
static int register_signal(int signo, ESCAPING Function<void(int)> handler);
static void unregister_signal(int handler_id);
// Invokes the specified handler when the process exits
static void register_process(pid_t pid, ESCAPING Function<void(pid_t)> exit_handler);
static void unregister_process(pid_t pid);
static bool is_running();
static EventLoop& current();
static NonnullRefPtr<WeakEventLoopReference> current_weak();