From 44c7068ebbc0165de98abe7a82c2d632158655cc Mon Sep 17 00:00:00 2001 From: akhropov Date: Thu, 10 Apr 2025 03:39:30 +0300 Subject: List captured variables explicitly when 'this' has been implicitly captured to avoid compiler warnings. commit_hash:6dda5bad9e3d887f91817bd4fdab95b66f3db001 --- library/cpp/threading/local_executor/local_executor.cpp | 2 +- library/cpp/threading/local_executor/tbb_local_executor.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'library/cpp/threading') diff --git a/library/cpp/threading/local_executor/local_executor.cpp b/library/cpp/threading/local_executor/local_executor.cpp index 4b4f69c0cbe..107f981ff70 100644 --- a/library/cpp/threading/local_executor/local_executor.cpp +++ b/library/cpp/threading/local_executor/local_executor.cpp @@ -57,7 +57,7 @@ namespace { void LocalExec(int id) override { Y_ASSERT(FirstId <= id && id < LastId); - NThreading::NImpl::SetValue(Promises[id - FirstId], [=] { Exec(id); }); + NThreading::NImpl::SetValue(Promises[id - FirstId], [this, id] { Exec(id); }); } TVector> GetFutures() const { diff --git a/library/cpp/threading/local_executor/tbb_local_executor.cpp b/library/cpp/threading/local_executor/tbb_local_executor.cpp index 91a8460b0eb..cad425a1a62 100644 --- a/library/cpp/threading/local_executor/tbb_local_executor.cpp +++ b/library/cpp/threading/local_executor/tbb_local_executor.cpp @@ -36,7 +36,7 @@ void NPar::TTbbLocalExecutor::Exec(TIntrusivePtr if (flags & WAIT_COMPLETE) { exec->LocalExec(id); } else { - TbbArena.execute([=] { + TbbArena.execute([this, exec, id] { SubmitAsyncTasks([=] (int id) { exec->LocalExec(id); }, id, id + 1); }); } @@ -55,8 +55,8 @@ void NPar::TTbbLocalExecutor::ExecRange(TIntrusivePtrLocalExec(id); }, firstId, lastId); + TbbArena.execute([this, exec, firstId, lastId] { + SubmitAsyncTasks([exec] (int id) { exec->LocalExec(id); }, firstId, lastId); }); } } -- cgit v1.3