projects
/
platform
/
core
/
api
/
base-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0920c05
)
Add mutex lock
61/309261/2
accepted/tizen_7.0_unified
tizen_7.0
accepted/tizen/7.0/unified/20240409.073821
accepted/tizen/7.0/unified/20240409.104415
author
DongHun Kwak
<dh0128.kwak@samsung.com>
Mon, 8 Apr 2024 05:01:56 +0000
(14:01 +0900)
committer
DongHun Kwak
<dh0128.kwak@samsung.com>
Mon, 8 Apr 2024 07:39:00 +0000
(16:39 +0900)
Change-Id: Ib374d339c90f7554adbfa247c4164192dcd16e44
std::map is not thread safe.
src/utils_i18n_private.cpp
patch
|
blob
|
history
diff --git
a/src/utils_i18n_private.cpp
b/src/utils_i18n_private.cpp
index
9ea0ef0
..
af6b9f5
100644
(file)
--- a/
src/utils_i18n_private.cpp
+++ b/
src/utils_i18n_private.cpp
@@
-16,12
+16,15
@@
#include <utils_i18n_private.h>
#include <map>
+#include <mutex>
+static std::mutex mMutex;
using namespace std;
int _i18n_error_mapping(int err) {
static map<int, int> err_map;
+ const std::lock_guard<std::mutex> lock(mMutex);
if(err_map.empty()) {
err_map.insert(make_pair(U_STRING_NOT_TERMINATED_WARNING, I18N_WARNING_STRING_NOT_TERMINATED));