mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Use c++11 thread_local instaed of gcc's __thread
This commit is contained in:
parent
e51f95872f
commit
443088ce31
@ -141,7 +141,7 @@ void MemoryTracker::setOrRaiseLimit(Int64 value)
|
||||
}
|
||||
|
||||
|
||||
__thread MemoryTracker * current_memory_tracker = nullptr;
|
||||
thread_local MemoryTracker * current_memory_tracker = nullptr;
|
||||
|
||||
namespace CurrentMemoryTracker
|
||||
{
|
||||
|
@ -108,7 +108,7 @@ public:
|
||||
* This pointer is set when memory consumption is monitored in current thread.
|
||||
* So, you just need to pass it to all the threads that handle one request.
|
||||
*/
|
||||
extern __thread MemoryTracker * current_memory_tracker;
|
||||
extern thread_local MemoryTracker * current_memory_tracker;
|
||||
|
||||
/// Convenience methods, that use current_memory_tracker if it is available.
|
||||
namespace CurrentMemoryTracker
|
||||
|
@ -402,7 +402,7 @@ private:
|
||||
*/
|
||||
static void terminate_handler()
|
||||
{
|
||||
static __thread bool terminating = false;
|
||||
static thread_local bool terminating = false;
|
||||
if (terminating)
|
||||
{
|
||||
abort();
|
||||
|
@ -4,7 +4,7 @@
|
||||
#include <Poco/Ext/ThreadNumber.h>
|
||||
|
||||
|
||||
static __thread unsigned thread_number = 0;
|
||||
static thread_local unsigned thread_number = 0;
|
||||
static unsigned threads = 0;
|
||||
|
||||
unsigned Poco::ThreadNumber::get()
|
||||
|
Loading…
Reference in New Issue
Block a user