diff --git a/src/core/async.hpp b/src/core/async.hpp index b01a62c114..0a5d32a797 100644 --- a/src/core/async.hpp +++ b/src/core/async.hpp @@ -31,7 +31,7 @@ inline SHVar awaitne(SHContext *context, FUNC &&func, CANCELLATION &&cancel) noe std::packaged_task task(std::move(func)); auto future = task.get_future(); - boost::asio::post(shards::SharedThreadPool(), std::move(task)); + boost::asio::post(shards::SharedThreadPool(), [&] { task(); }); auto complete = future.wait_for(std::chrono::milliseconds(0)) == std::future_status::ready; while (!complete && context->shouldContinue()) { @@ -70,7 +70,7 @@ template inline void await(SHContext *con std::packaged_task task(std::move(func)); auto future = task.get_future(); - boost::asio::post(shards::SharedThreadPool(), std::move(task)); + boost::asio::post(shards::SharedThreadPool(), [&] { task(); }); auto complete = future.wait_for(std::chrono::milliseconds(0)) == std::future_status::ready; while (!complete && context->shouldContinue()) { diff --git a/src/core/shards/process.cpp b/src/core/shards/process.cpp index 827fab1ad0..5e11a2a446 100644 --- a/src/core/shards/process.cpp +++ b/src/core/shards/process.cpp @@ -185,6 +185,7 @@ struct Run { } }, [&] { + SHLOG_DEBUG("Process terminated"); if(pCmd) { (*pCmd)->terminate(); }