[*] Refactor AddLoopSource

This commit is contained in:
Reece Wilson 2021-10-03 13:43:58 +01:00
parent 6c0907fe9e
commit 499f553e15
3 changed files with 3 additions and 3 deletions

View File

@ -245,7 +245,7 @@ namespace Aurora::Async
virtual bool Poll(bool block) = 0;
virtual bool AddLoopSource(const AuSPtr<Loop::ILoopSource> &loopSource, WorkerId_t workerId, AuUInt32 timeout, const AuConsumer<AuSPtr<Loop::ILoopSource>, bool> &callback) = 0;
virtual bool ScheduleLoopSource(const AuSPtr<Loop::ILoopSource> &loopSource, WorkerId_t workerId, AuUInt32 timeout, const AuConsumer<AuSPtr<Loop::ILoopSource>, bool> &callback) = 0;
};

View File

@ -248,7 +248,7 @@ namespace Aurora::Async
return ranAtLeastOne;
}
bool AsyncApp::AddLoopSource(const AuSPtr<Loop::ILoopSource> &loopSource, WorkerId_t workerId, AuUInt32 timeout, const AuConsumer<AuSPtr<Loop::ILoopSource>, bool> &callback)
bool AsyncApp::ScheduleLoopSource(const AuSPtr<Loop::ILoopSource> &loopSource, WorkerId_t workerId, AuUInt32 timeout, const AuConsumer<AuSPtr<Loop::ILoopSource>, bool> &callback)
{
auto thread = this->GetThreadHandle(workerId);
if (!thread)

View File

@ -62,7 +62,7 @@ namespace Aurora::Async
bool CtxYield();
int CfxPollPush();
void CtxPollReturn(const AuSPtr<ThreadState> &state, int status, bool hitTask);
bool AddLoopSource(const AuSPtr<Loop::ILoopSource> &loopSource, WorkerId_t workerId, AuUInt32 timeout, const AuConsumer<AuSPtr<Loop::ILoopSource>, bool> &callback) override;
bool ScheduleLoopSource(const AuSPtr<Loop::ILoopSource> &loopSource, WorkerId_t workerId, AuUInt32 timeout, const AuConsumer<AuSPtr<Loop::ILoopSource>, bool> &callback) override;
private:
AuSPtr<ThreadState> GetThreadHandle(WorkerId_t id);