From: Piotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics
Date: Wed, 10 Nov 2021 09:31:08 +0000 (+0100)
Subject: [Common] Changes TaskQueue to thread_local storage duration
X-Git-Tag: submit/tizen/20220114.063030~1
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=02d1db1a79bd548387eeee3a9911cbafe9d45768;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git
[Common] Changes TaskQueue to thread_local storage duration
This change is to prevent issues with accessing same TaskQueue object by
several threads in multi-thread service model introduced in Tizen 6.5.
Similar change -
https://review.tizen.org/gerrit/#/c/platform/core/api/webapi-plugins/+/263367/
[Verification] executed all automatic TCT - 100% passrate.
Change-Id: I0c8ac1d7ffe1a9fad08eda6e2129abf659cbe9db
---
diff --git a/src/common/task-queue.cpp b/src/common/task-queue.cpp
index 139f554c..0f7a331a 100644
--- a/src/common/task-queue.cpp
+++ b/src/common/task-queue.cpp
@@ -19,7 +19,7 @@
namespace common {
TaskQueue& TaskQueue::GetInstance() {
- static TaskQueue task_queue;
+ thread_local TaskQueue task_queue;
return task_queue;
}