[...] cont

This commit is contained in:
Reece Wilson 2021-10-01 17:32:50 +01:00
parent 9436b12455
commit ea83fcef20
3 changed files with 8 additions and 5 deletions

View File

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

View File

@ -353,7 +353,7 @@ namespace Aurora::Async
state->loopSources.clear();
state->loopSources.reserve(curLoopReq.size());
if (AuTryFind(nextLoopSources, group->eventLs))
if (std::find(nextLoopSources.begin(), nextLoopSources.end(), group->eventLs) != nextLoopSources.end())
{
PollInternal(false);
}
@ -362,8 +362,8 @@ namespace Aurora::Async
{
bool remove {};
bool removeType {};
if (AuTryFind(nextLoopSources, request.loopSource))
if (std::find(nextLoopSources.begin(), nextLoopSources.end(), request.loopSource) != nextLoopSources.end())
{
remove = true;
removeType = true;

View File

@ -52,14 +52,17 @@ namespace Aurora::Async
void AssertWorker(WorkerId_t id) override;
void Run(WorkerId_t target, AuSPtr<IAsyncRunnable> runnable);
bool Poll(bool block) override;
bool PollInternal(bool block);
bool PollLoopSource(bool block);
size_t GetThreadWorkersCount(ThreadGroup_t group);
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;
private:
AuSPtr<ThreadState> GetThreadHandle(WorkerId_t id);