mirror of https://github.com/Icinga/icinga2.git
IoEngine#SpawnCoroutine(): remove redundand overload
This commit is contained in:
parent
d98493c90f
commit
0ed0f73d9d
|
@ -114,7 +114,6 @@ public:
|
|||
#endif /* _WIN32 */
|
||||
}
|
||||
|
||||
/* With dedicated strand in *Connection classes. */
|
||||
template <typename Handler, typename Function>
|
||||
static void SpawnCoroutine(Handler& h, Function f) {
|
||||
|
||||
|
@ -136,28 +135,6 @@ public:
|
|||
);
|
||||
}
|
||||
|
||||
/* Without strand in the IO executor's context. */
|
||||
template <typename Function>
|
||||
static void SpawnCoroutine(boost::asio::io_context& io, Function f) {
|
||||
|
||||
boost::asio::spawn(io,
|
||||
[f](boost::asio::yield_context yc) {
|
||||
|
||||
try {
|
||||
f(yc);
|
||||
} catch (const boost::coroutines::detail::forced_unwind &) {
|
||||
// Required for proper stack unwinding when coroutines are destroyed.
|
||||
// https://github.com/boostorg/coroutine/issues/39
|
||||
throw;
|
||||
} catch (...) {
|
||||
// Handle uncaught exceptions outside of the coroutine.
|
||||
rethrowBoostExceptionPointer();
|
||||
}
|
||||
},
|
||||
boost::coroutines::attributes(GetCoroutineStackSize()) // Set a pre-defined stack size.
|
||||
);
|
||||
}
|
||||
|
||||
private:
|
||||
IoEngine();
|
||||
|
||||
|
|
Loading…
Reference in New Issue