diff options
author | akhropov <akhropov@yandex-team.com> | 2025-04-10 03:39:30 +0300 |
---|---|---|
committer | akhropov <akhropov@yandex-team.com> | 2025-04-10 03:51:24 +0300 |
commit | 44c7068ebbc0165de98abe7a82c2d632158655cc (patch) | |
tree | 329122f99fa2a888a8e99d792321fb6456a8d1c0 /library/cpp/threading/local_executor | |
parent | f489e479c78e4192f2d5ec693f8c1d1b5774b8a0 (diff) | |
download | ydb-44c7068ebbc0165de98abe7a82c2d632158655cc.tar.gz |
List captured variables explicitly when 'this' has been implicitly captured to avoid compiler warnings.
commit_hash:6dda5bad9e3d887f91817bd4fdab95b66f3db001
Diffstat (limited to 'library/cpp/threading/local_executor')
-rw-r--r-- | library/cpp/threading/local_executor/local_executor.cpp | 2 | ||||
-rw-r--r-- | library/cpp/threading/local_executor/tbb_local_executor.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
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<NThreading::TFuture<void>> 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<RespectTls>::Exec(TIntrusivePtr<ILocallyExecutable> 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<RespectTls>::ExecRange(TIntrusivePtr<ILocallyExecut } }); } else { - TbbArena.execute([=] { - SubmitAsyncTasks([=] (int id) { exec->LocalExec(id); }, firstId, lastId); + TbbArena.execute([this, exec, firstId, lastId] { + SubmitAsyncTasks([exec] (int id) { exec->LocalExec(id); }, firstId, lastId); }); } } |