From: Kimmo Hoikka Date: Wed, 16 Aug 2017 10:55:33 +0000 (+0100) Subject: Replace GCC specific __thread with C++ 11 keyword thread_local X-Git-Tag: dali_1.2.53~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b08c188557231dc3f3dc7bf5fb9b89241cf002f;hp=d7ef4c059b82144923dda3ab1ea7915bde2e1796;p=platform%2Fcore%2Fuifw%2Fdali-core.git Replace GCC specific __thread with C++ 11 keyword thread_local Change-Id: I8bfd5684a7c198a332c81362eb643851bf2d5e77 --- diff --git a/dali/integration-api/debug.cpp b/dali/integration-api/debug.cpp index 2624818..11b5c35 100644 --- a/dali/integration-api/debug.cpp +++ b/dali/integration-api/debug.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,7 +94,7 @@ namespace Integration namespace Log { -__thread LogFunction gthreadLocalLogFunction = NULL; +thread_local LogFunction gthreadLocalLogFunction = NULL; /* Forward declarations */ std::string FormatToString(const char *format, ...); diff --git a/dali/internal/common/mutex-impl.cpp b/dali/internal/common/mutex-impl.cpp index 06d1ddf..9c85e83 100644 --- a/dali/internal/common/mutex-impl.cpp +++ b/dali/internal/common/mutex-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,11 +59,11 @@ struct BackTraceInfo int size; ///< Number of frames in the frame array (can be less than MAX_NUM_STACK_FRAMES) }; -__thread BackTraceInfo gBackTraceInfo[ MAX_LOCK_SUPPORT ]; ///< Thread local storage for the backtrace of the locks +thread_local BackTraceInfo gBackTraceInfo[ MAX_LOCK_SUPPORT ]; ///< Thread local storage for the backtrace of the locks #endif // LOCK_BACKTRACE_ENABLED -__thread unsigned int gThreadLockCount = 0; ///< +thread_local unsigned int gThreadLockCount = 0; ///< Thread local storage for the backtrace of the locks } // unnamed namespace void Lock( pthread_mutex_t* mutex ) diff --git a/dali/internal/event/common/thread-local-storage.cpp b/dali/internal/event/common/thread-local-storage.cpp index f59bd27..559b833 100644 --- a/dali/internal/event/common/thread-local-storage.cpp +++ b/dali/internal/event/common/thread-local-storage.cpp @@ -30,7 +30,7 @@ namespace Internal namespace { -__thread ThreadLocalStorage* threadLocal = NULL; +thread_local ThreadLocalStorage* threadLocal = NULL; } ThreadLocalStorage::ThreadLocalStorage(Core* core)