This commit is contained in:
aozhiwei 2023-05-27 14:44:43 +08:00
parent 9f0679adc2
commit 1607ee5487
2 changed files with 7 additions and 2 deletions

View File

@ -20,7 +20,7 @@ void CoMgr::Init()
[i] (Coroutine* co)
{
a8::XPrintf("call subco A %d %d\n", {i, a8::XGetTickCount()});
co->CoAwait(co->Sleep(3000));
//co->CoAwait(co->Sleep(3000));
}).lock());
a8::XPrintf("call A %d %d\n", {i, a8::XGetTickCount()});
}

View File

@ -115,7 +115,12 @@ void Coroutine::CallExit(boost::coroutines2::coroutine<void>::push_type& sink)
void Coroutine::DoAwait()
{
done_ = true;
for (auto notifyer : notifyers_) {
if (!notifyer.expired()) {
notifyer.lock()->DoResume();
}
}
}
void Coroutine::DoResume()