mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +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:
committed by
Andreas Kling
parent
a714fc661d
commit
d8387f1506
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user