aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/threading/local_executor/tbb_local_executor.h
diff options
context:
space:
mode:
authorAlexander Smirnov <alex@ydb.tech>2025-04-07 08:39:07 +0000
committerAlexander Smirnov <alex@ydb.tech>2025-04-07 08:39:07 +0000
commit288a443b15bc64c9676fb70884e73e6aba03e108 (patch)
tree9e6a6f10fffb8273222d14c68c0d0a79f1faf394 /library/cpp/threading/local_executor/tbb_local_executor.h
parentc3301110258be632f5b73a6e348d5f9d98f3eacc (diff)
parentcbea66c165a9c9d142053892cac24550a030656c (diff)
downloadydb-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.h10
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;
};
}