From ac3c8a9d22d43bac833a242409fa7d35b337f4d0 Mon Sep 17 00:00:00 2001
From: "Piotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics"
Date: Mon, 20 Jan 2025 12:47:32 +0100
Subject: [PATCH] [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
---
src/common/current_application.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
--
2.34.1