Skip to content

Commit

Permalink
more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkingsugar committed Feb 21, 2023
1 parent 1d1ec55 commit 112704e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/async.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ inline SHVar awaitne(SHContext *context, FUNC &&func, CANCELLATION &&cancel) noe
std::packaged_task<SHVar()> 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()) {
Expand Down Expand Up @@ -70,7 +70,7 @@ template <typename FUNC, typename CANCELLATION> inline void await(SHContext *con
std::packaged_task<void()> 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()) {
Expand Down
1 change: 1 addition & 0 deletions src/core/shards/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ struct Run {
}
},
[&] {
SHLOG_DEBUG("Process terminated");
if(pCmd) {
(*pCmd)->terminate();
}
Expand Down

0 comments on commit 112704e

Please sign in to comment.