From: Piotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics Date: Mon, 20 Jan 2025 11:47:32 +0000 (+0100) Subject: [Common] Changed CurrentApplication to thread local X-Git-Tag: accepted/tizen/unified/20250214.120516~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ac3c8a9d22d43bac833a242409fa7d35b337f4d0;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Common] Changed CurrentApplication to thread local CurrentApplication can be accessed by different threads of wrt-services To protect it from parallel access, it become thread local. [Verification] Code compiles without errors. Change-Id: Ic3f20db211a3eb00649b152542deb4a3901ffe7c --- diff --git a/src/common/current_application.cc b/src/common/current_application.cc index e99e6b89..7f5c2e88 100644 --- a/src/common/current_application.cc +++ b/src/common/current_application.cc @@ -37,7 +37,7 @@ std::string GetRuntimeVariable(const char* variable_name) { CurrentApplication &CurrentApplication::GetInstance() { ScopeLogger(); - static CurrentApplication current_application; + thread_local CurrentApplication current_application; return current_application; }