/*** Copyright (C) 2023 J Reece Wilson (a/k/a "Reece"). All rights reserved. File: CompletionGroupLoopSource.hpp Date: 2023-12-28 Author: Reece ***/ #pragma once #include #include namespace Aurora::IO::CompletionGroup { struct CompletionGroupLoopSource : Loop::LSEvent // Loop::LSLocalEvent -> not going to work on NT. ugh // Nt is going to expect event handles... // ...outside of XPs dumb-fuck SignalAndWait api because nobody at msft knew how to implement a condvar, every other IO subsystem is documented to expect event handles, not semaphore kernel objects. // linshid: we always use eventfd // posix: we could always fallback on pipe fds // bsd: doesnt matter so long as the kqueue supplier for loopqueues is in place { CompletionGroupLoopSource(CompletionGroup *pParent, bool bAnd); bool DoInit(bool bSignaledAlready); bool IsSignaled() override; bool OnTrigger(AuUInt handle) override; Loop::ELoopSource GetType() override; CompletionGroup *pParent; bool bIsAnd {}; }; }