Use c++11 thread_local instaed of gcc's __thread

This commit is contained in:
proller 2017-10-19 22:36:37 +03:00
parent e51f95872f
commit 443088ce31
4 changed files with 4 additions and 4 deletions

View File

@ -141,7 +141,7 @@ void MemoryTracker::setOrRaiseLimit(Int64 value)
}
__thread MemoryTracker * current_memory_tracker = nullptr;
thread_local MemoryTracker * current_memory_tracker = nullptr;
namespace CurrentMemoryTracker
{

View File

@ -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

View File

@ -402,7 +402,7 @@ private:
*/
static void terminate_handler()
{
static __thread bool terminating = false;
static thread_local bool terminating = false;
if (terminating)
{
abort();

View File

@ -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()