win32/ComWorker: rename variable name to prevent ambiguous

This commit is contained in:
Shen-Ta Hsieh 2023-05-30 02:13:25 +08:00 committed by Max Kellermann
parent 18d3a5c12b
commit bcb393628e
1 changed files with 6 additions and 6 deletions

View File

@ -52,17 +52,17 @@ public:
using R = std::invoke_result_t<std::decay_t<Function>>;
auto promise = std::make_shared<Promise<R>>();
auto future = promise->get_future();
Push([function = std::forward<Function>(function),
promise = std::move(promise)]() mutable {
Push([func = std::forward<Function>(function),
prom = std::move(promise)]() mutable {
try {
if constexpr (std::is_void_v<R>) {
std::invoke(std::forward<Function>(function));
promise->set_value();
std::invoke(std::forward<Function>(func));
prom->set_value();
} else {
promise->set_value(std::invoke(std::forward<Function>(function)));
prom->set_value(std::invoke(std::forward<Function>(func)));
}
} catch (...) {
promise->set_exception(std::current_exception());
prom->set_exception(std::current_exception());
}
});
return future;