Replace GCC specific __thread with C++ 11 keyword thread_local 83/144383/2
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Wed, 16 Aug 2017 11:00:25 +0000 (12:00 +0100)
committerKimmo Hoikka <kimmo.hoikka@samsung.com>
Wed, 16 Aug 2017 11:02:27 +0000 (11:02 +0000)
Change-Id: I0a3725b53f2cdb48ad0ba0b26e60ef75ef7c46c3

adaptors/common/adaptor-impl.cpp
adaptors/common/singleton-service-impl.cpp

index 7261e4e..08fe0e0 100644 (file)
@@ -68,7 +68,7 @@ namespace Adaptor
 
 namespace
 {
-__thread Adaptor* gThreadLocalAdaptor = NULL; // raw thread specific pointer to allow Adaptor::Get
+thread_local Adaptor* gThreadLocalAdaptor = NULL; // raw thread specific pointer to allow Adaptor::Get
 } // unnamed namespace
 
 Dali::Adaptor* Adaptor::New( Any nativeWindow, RenderSurface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
index d975d94..5ee6180 100644 (file)
@@ -48,10 +48,9 @@ namespace Internal
 namespace Adaptor
 {
 
-// @todo Start using pthread_key_create if we want to avoid leaking the SingletonService on shutdown
 namespace
 {
-__thread SingletonService * gSingletonService = 0;
+thread_local SingletonService * gSingletonService = 0;
 } // unnamed namespace
 
 Dali::SingletonService SingletonService::New()