examples & tests use context instead of coroutine.

This commit is contained in:
Klemens authored and Klemens Morgenstern committed 2023-02-02 23:27:49 +08:00
1 parent 1841a592d6
commit 99bceb5bff
24 files changed
+156 -37

No files matched your search

@@ -128,14 +128,20 @@ spawn(F0&& f, FN&&... fn)
[&]
{
asio::spawn(ioc_,
std::allocator_arg,
boost::context::fixedsize_stack(2 * 1024 * 1024),
[&](yield_context yield)
{
f(yield);
std::lock_guard<std::mutex> lock{m_};
if(--running_ == 0)
cv_.notify_all();
}
, boost::coroutines::attributes(2 * 1024 * 1024));
},
[](std::exception_ptr e)
{
if (e)
std::rethrow_exception(e);
});
});
spawn(fn...);
}