[Common] Changes TaskQueue to thread_local storage duration 97/266297/1
authorPiotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics <p.kosko@samsung.com>
Wed, 10 Nov 2021 09:31:08 +0000 (10:31 +0100)
committerPiotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics <p.kosko@samsung.com>
Wed, 10 Nov 2021 09:31:08 +0000 (10:31 +0100)
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

src/common/task-queue.cpp

index 139f554..0f7a331 100644 (file)
@@ -19,7 +19,7 @@
 namespace common {
 
 TaskQueue& TaskQueue::GetInstance() {
-  static TaskQueue task_queue;
+  thread_local TaskQueue task_queue;
   return task_queue;
 }