diff --git a/tests/unit/rpc/tcp_test.cpp b/tests/unit/rpc/tcp_test.cpp index b6c3d91e6..eab9b6d2d 100644 --- a/tests/unit/rpc/tcp_test.cpp +++ b/tests/unit/rpc/tcp_test.cpp @@ -175,14 +175,14 @@ TEST(tcp_rpc_test, async_echo_test) { server.register_handler_callback( [](request req, std::function)> cb) -> bool { - std::thread([cb = std::move(cb), r = req]() { + std::thread([cb_inner = std::move(cb), r = req]() { auto resp = response{}; std::visit( [&](auto val) { resp = val; }, r); - cb(resp); + cb_inner(resp); }).detach(); return true; }); @@ -229,8 +229,8 @@ TEST(tcp_rpc_test, async_error_test) { [](request req, std::function)> cb) -> bool { if(req) { - std::thread([cb = std::move(cb)]() { - cb(std::nullopt); + std::thread([cb_inner = std::move(cb)]() { + cb_inner(std::nullopt); }).detach(); } return req; diff --git a/tools/bench/twophase_gen.cpp b/tools/bench/twophase_gen.cpp index 0b86eb518..0326c5187 100644 --- a/tools/bench/twophase_gen.cpp +++ b/tools/bench/twophase_gen.cpp @@ -242,7 +242,7 @@ auto main(int argc, char** argv) -> int { .count(); auto res_cb - = [&, txn = tx.value(), send_time = send_time]( + = [&, txn = tx.value(), send_time]( cbdc::sentinel::rpc::client::execute_result_type res) { auto tx_id = cbdc::transaction::tx_id(txn); if(!res.has_value()) {