Commit bcb39362 authored by Shen-Ta Hsieh's avatar Shen-Ta Hsieh Committed by Max Kellermann

win32/ComWorker: rename variable name to prevent ambiguous

parent 18d3a5c1
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment