X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fcommon%2Fthread-local-storage.cpp;h=86e848d99dec4cd1631af6782d16ad47486399b8;hb=d67b366a74050ddec47340ff10a0188c0d381561;hp=aca21f47b242339ac30c9fd6c17ffc97fe272c45;hpb=77b488c3d1c388a9a472a5bd00a0d04797120c68;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/common/thread-local-storage.cpp b/dali/internal/event/common/thread-local-storage.cpp index aca21f4..86e848d 100644 --- a/dali/internal/event/common/thread-local-storage.cpp +++ b/dali/internal/event/common/thread-local-storage.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -34,7 +34,7 @@ Debug::Filter* gSingletonServiceLogFilter = Debug::Filter::New(Debug::NoLogging, if(gSingletonServiceLogFilter && gSingletonServiceLogFilter->IsEnabledFor(level)) \ { \ std::string string(message); \ - Dali::TizenPlatform::LogMessage(Debug::DebugInfo, string); \ + Dali::TizenPlatform::LogMessage(Debug::INFO, string); \ } #define DALI_LOG_SINGLETON_SERVICE(level, format, ...) DALI_LOG_INFO(gSingletonServiceLogFilter, level, format, ##__VA_ARGS__) @@ -51,22 +51,25 @@ namespace Internal { namespace { -thread_local ThreadLocalStorage* threadLocal = nullptr; -} +thread_local ThreadLocalStorage* threadLocal = nullptr; +thread_local bool isShuttingDown = false; +} // namespace ThreadLocalStorage::ThreadLocalStorage(Core* core) : mCore(core) { DALI_ASSERT_ALWAYS(threadLocal == nullptr && "Cannot create more than one ThreadLocalStorage object"); - threadLocal = this; + threadLocal = this; + isShuttingDown = false; } ThreadLocalStorage::~ThreadLocalStorage() = default; void ThreadLocalStorage::Remove() { - threadLocal = nullptr; + threadLocal = nullptr; + isShuttingDown = true; } ThreadLocalStorage& ThreadLocalStorage::Get() @@ -92,6 +95,11 @@ bool ThreadLocalStorage::Created() return (threadLocal != nullptr); } +bool ThreadLocalStorage::IsShuttingDown() +{ + return isShuttingDown; +} + ThreadLocalStorage* ThreadLocalStorage::GetInternal() { return threadLocal;