forked from boostorg/beast
examples & tests use context instead of coroutine.
This commit is contained in:
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...);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user