mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
CNotifier: Turn into a CObject and Use the event queue to deliver events
This way, CNotifier can mutate state to its little heart's content without destroying the world when the global CNotifier hash changes during delivery.
This commit is contained in:
parent
a714fc661d
commit
d8387f1506
Notes:
sideshowbarker
2024-07-19 13:14:15 +09:00
Author: https://github.com/rburchell
Commit: d8387f1506
Pull-request: https://github.com/SerenityOS/serenity/pull/321
Reviewed-by: https://github.com/awesomekling ✅
4 changed files with 50 additions and 3 deletions
|
@ -245,11 +245,11 @@ void CEventLoop::wait_for_event(WaitMode mode)
|
|||
for (auto& notifier : *s_notifiers) {
|
||||
if (FD_ISSET(notifier->fd(), &rfds)) {
|
||||
if (notifier->on_ready_to_read)
|
||||
notifier->on_ready_to_read();
|
||||
post_event(*notifier, make<CNotifierReadEvent>(notifier->fd()));
|
||||
}
|
||||
if (FD_ISSET(notifier->fd(), &wfds)) {
|
||||
if (notifier->on_ready_to_write)
|
||||
notifier->on_ready_to_write();
|
||||
post_event(*notifier, make<CNotifierWriteEvent>(notifier->fd()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue