LibCore: Allow posting stateless events without heap-allocated Event

This patch adds an API for posting a Core::Event::Type to the thread
event queue without requiring a full Core::Event object.

We use this API to avoid heap allocations for every timer and notifier
activation event.
This commit is contained in:
Andreas Kling
2025-12-03 11:38:19 +01:00
committed by Andreas Kling
parent 23fb9781d1
commit 69515f8c85
Notes: github-actions[bot] 2025-12-03 12:27:51 +00:00
5 changed files with 48 additions and 15 deletions

View File

@@ -27,6 +27,7 @@ public:
// Posts an event to the event queue.
void post_event(EventReceiver*, NonnullOwnPtr<Event>);
void post_event(EventReceiver*, Core::Event::Type);
// Used by Threading::BackgroundAction.
void add_job(NonnullRefPtr<Promise<NonnullRefPtr<EventReceiver>>>);