[*] Refactor AddLoopSource
This commit is contained in:
parent
6c0907fe9e
commit
499f553e15
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user