diff --git a/server/robotserver/comgr.cc b/server/robotserver/comgr.cc index 30a140a5..9278ffb9 100644 --- a/server/robotserver/comgr.cc +++ b/server/robotserver/comgr.cc @@ -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()}); } diff --git a/server/robotserver/coroutine.cc b/server/robotserver/coroutine.cc index 06be912f..784114fe 100644 --- a/server/robotserver/coroutine.cc +++ b/server/robotserver/coroutine.cc @@ -115,7 +115,12 @@ void Coroutine::CallExit(boost::coroutines2::coroutine::push_type& sink) void Coroutine::DoAwait() { - + done_ = true; + for (auto notifyer : notifyers_) { + if (!notifyer.expired()) { + notifyer.lock()->DoResume(); + } + } } void Coroutine::DoResume()