aboutsummaryrefslogtreecommitdiffstats
path: root/vespamalloc
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2020-10-20 13:04:27 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2020-10-20 13:04:27 +0000
commit12f27fcc49be2a1f444122a185735743c18684f6 (patch)
tree0e0b7d1ba0cc97ed35cf961eae8d1993f1fda3fa /vespamalloc
parent36f8d6761ef4bed884c884c7f673e6c7d847af7f (diff)
Allow for faster access of thread local variable.
This is possible since we do not load our code explicit as dynamic library. Also replace __thread by standard c++ linkage thread_local.
Diffstat (limited to 'vespamalloc')
-rw-r--r--vespamalloc/src/vespamalloc/malloc/threadlist.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/vespamalloc/src/vespamalloc/malloc/threadlist.h b/vespamalloc/src/vespamalloc/malloc/threadlist.h
index 6e518091f0f..149396a3bff 100644
--- a/vespamalloc/src/vespamalloc/malloc/threadlist.h
+++ b/vespamalloc/src/vespamalloc/malloc/threadlist.h
@@ -45,10 +45,10 @@ private:
std::atomic<size_t> _threadCountAccum;
ThreadPool _threadVector[NUM_THREADS];
AllocPoolT<MemBlockPtrT> & _allocPool;
- static __thread ThreadPool * _myPool TLS_LINKAGE;
+ static thread_local ThreadPool * _myPool TLS_LINKAGE;
};
template <typename MemBlockPtrT, typename ThreadStatT>
-__thread ThreadPoolT<MemBlockPtrT, ThreadStatT> * ThreadListT<MemBlockPtrT, ThreadStatT>::_myPool TLS_LINKAGE = nullptr;
+thread_local ThreadPoolT<MemBlockPtrT, ThreadStatT> * ThreadListT<MemBlockPtrT, ThreadStatT>::_myPool TLS_LINKAGE = nullptr;
}