diff options
author | Alexander Smirnov <alex@ydb.tech> | 2025-04-07 08:39:07 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2025-04-07 08:39:07 +0000 |
commit | 288a443b15bc64c9676fb70884e73e6aba03e108 (patch) | |
tree | 9e6a6f10fffb8273222d14c68c0d0a79f1faf394 /library/cpp/threading/local_executor/tbb_local_executor.h | |
parent | c3301110258be632f5b73a6e348d5f9d98f3eacc (diff) | |
parent | cbea66c165a9c9d142053892cac24550a030656c (diff) | |
download | ydb-288a443b15bc64c9676fb70884e73e6aba03e108.tar.gz |
Merge pull request #16825 from ydb-platform/merge-libs-250407-0050
Diffstat (limited to 'library/cpp/threading/local_executor/tbb_local_executor.h')
-rw-r--r-- | library/cpp/threading/local_executor/tbb_local_executor.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/library/cpp/threading/local_executor/tbb_local_executor.h b/library/cpp/threading/local_executor/tbb_local_executor.h index 8d790db18c..f67c07349d 100644 --- a/library/cpp/threading/local_executor/tbb_local_executor.h +++ b/library/cpp/threading/local_executor/tbb_local_executor.h @@ -9,6 +9,9 @@ #include <contrib/libs/tbb/include/tbb/task_arena.h> #include <contrib/libs/tbb/include/tbb/task_group.h> +#include <atomic> + + namespace NPar { template <bool RespectTls = false> class TTbbLocalExecutor final: public ILocalExecutor { @@ -16,10 +19,11 @@ namespace NPar { TTbbLocalExecutor(int nThreads) : ILocalExecutor() , TbbArena(nThreads) - , NumberOfTbbThreads(nThreads) {} + , NumberOfTbbThreads(nThreads) + , RegisteredThreadCounter(0) + {} ~TTbbLocalExecutor() noexcept override {} - // 0-based ILocalExecutor worker thread identification virtual int GetWorkerThreadId() const noexcept override; virtual int GetThreadCount() const noexcept override; @@ -45,5 +49,7 @@ namespace NPar { mutable tbb::task_arena TbbArena; tbb::task_group Group; int NumberOfTbbThreads; + + mutable std::atomic_int RegisteredThreadCounter; }; } |