Use thread_local (instead of static) storage duration due to thread safety issue. 71/272171/1
authorMarcin Bialek <m.bialek@samsung.com>
Mon, 8 Nov 2021 12:19:28 +0000 (13:19 +0100)
committerPiotr Kosko <p.kosko@samsung.com>
Thu, 10 Mar 2022 09:38:57 +0000 (09:38 +0000)
Similar issue: 605574a932c7ddac63bb394d520178d332ed05dc

[Verification] TCT tests and a sample application.

Change-Id: I988fb82763999751ce56d77847013506fea5875c
(cherry picked from commit 122bae587fb3d4d1879f567baa97b72bdd6a1a5a)

src/common/filesystem/filesystem_provider_deviced.cc

index 60bc109..3fd71bc 100644 (file)
@@ -146,7 +146,7 @@ FilesystemProviderDeviced::FilesystemProviderDeviced()
 FilesystemProviderDeviced& FilesystemProviderDeviced::Create() {
   ScopeLogger();
 
-  static FilesystemProviderDeviced instance;
+  thread_local FilesystemProviderDeviced instance;
 
   return instance;
 }