6#include "dawn/io/notify_manager.hxx"
12CIONotifierManager::CIONotifierManager()
16CIONotifierManager::~CIONotifierManager()
24 for (
auto &e : entries)
34#ifdef CONFIG_DAWN_IO_NOTIFY_STREAM
54 for (
auto &e : entries)
65int CIONotifierManager::regIO(
CIOCommon *io)
84 type = io->getNotifyType();
85 prio = io->getNotifyPrio();
96 notifier = findPoll(prio);
97 if (notifier ==
nullptr)
100 if (notifier ==
nullptr)
102 DAWNERR(
"Failed to allocate poll notifier\n");
106 notifier->setThreadPriority(prio);
110 entry.poll = notifier;
111 entries.push_back(entry);
116 io->bindNotifier(notifier);
120#ifdef CONFIG_DAWN_IO_NOTIFY_STREAM
124 SNotifierEntry entry;
129 if (notifier ==
nullptr)
131 DAWNERR(
"Failed to allocate stream notifier\n");
135 notifier->setThreadPriority(prio);
139 entry.stream = notifier;
140 entries.push_back(entry);
144 io->bindNotifier(notifier);
151 DAWNERR(
"Unsupported notifier type %d\n", type);
158 io->setNotifier(
nullptr, 0, 0);
163int CIONotifierManager::start()
167 for (
auto &e : entries)
173 ret = e.poll->
start();
177#ifdef CONFIG_DAWN_IO_NOTIFY_STREAM
180 ret = e.stream->start();
194 DAWNERR(
"Failed to start notifier (type=%d prio=%d err=%d)\n", e.type, e.prio, ret);
202int CIONotifierManager::stop()
204 for (
auto &e : entries)
214#ifdef CONFIG_DAWN_IO_NOTIFY_STREAM
Base class for all I/O objects.
virtual bool isNotify() const =0
Check if IO supports notifications.
virtual int getFd() const
Get file descriptor for notifications.
@ IO_NOTIFY_POLL
Poll-based notifier (default)
@ IO_NOTIFY_STREAM
Stream notifier (blocking read, one per IO)
I/O notification handler with poll-based event delivery.
Stream-based I/O notifier with dedicated thread per I/O.
Out-of-tree user-extension hooks for Dawn.