18#include <AUI/Thread/AThread.h>
20#include "UnixEventFd.h"
21#include <AUI/Thread/AFuture.h>
22#include <AUI/Util/ABitField.h>
23#include <unordered_map>
28AUI_ENUM_FLAG(UnixPollEvent) {
33AUI_ENUM_FLAG(UnixPollEvent) {
43class API_AUI_CORE UnixIoThread {
47 static UnixIoThread& inst()
noexcept;
50 void unregisterCallback(
int fd)
noexcept;
53 friend class UnixIoEventLoop;
60 struct CallbackEntry {
67 std::unordered_map<
int , FDInfo> mFdInfo;
74 template<aui::invocable Callback>
75 void executeOnIoThreadBlocking(Callback&& callback) {
82 mMessageQueue.enqueue([&] {
90 UnixIoThread()
noexcept;
Bit field implementation.
Definition ABitField.h:20
Represents a value that will be available at some point in the future.
Definition AFuture.h:620
void supplyValue(T v) const noexcept
Pushes the result to AFuture.
Definition AFuture.h:650
Universal thread-safe message (callback) queue implementation.
Definition AMessageQueue.h:29
static _< AAbstractThread > current()
Definition AThread.cpp:197
A std::vector with AUI extensions.
Definition AVector.h:39
File-descriptor object to trigger select/poll/epoll/kqueue.
Definition UnixEventFd.h:27
An std::weak_ptr with AUI extensions.
Definition SharedPtrTypes.h:178
void wait(AFutureWait flags=AFutureWait::DEFAULT) const
Sleeps if the supplyValue is not currently available.
Definition AFuture.h:465
Basic syscall-based synchronization primitive.
Definition AMutex.h:33