projects
/
platform
/
core
/
appfw
/
rpc-port.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b3af76
)
Add a missing mutex lock
08/320008/2
author
Hwankyu Jhun
<h.jhun@samsung.com>
Wed, 6 Nov 2024 11:08:45 +0000
(20:08 +0900)
committer
HwanKyu Jhun
<h.jhun@samsung.com>
Wed, 6 Nov 2024 11:08:24 +0000
(11:08 +0000)
Before using condition variable, we should lock the mutex to avoid
a timing issue.
Change-Id: I78c22d275a3dfc08087ec722cb9d0c53d08c3c19
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/rpc-port/cynara_thread.cc
patch
|
blob
|
history
diff --git
a/src/rpc-port/cynara_thread.cc
b/src/rpc-port/cynara_thread.cc
index 01458402ebd4096874265d4248063c4dca88f486..fbb2ee8faab7b0219b6c2cf56d1d459dedeea9c1 100644
(file)
--- a/
src/rpc-port/cynara_thread.cc
+++ b/
src/rpc-port/cynara_thread.cc
@@
-49,8
+49,11
@@
CynaraThread::~CynaraThread() {
void CynaraThread::Dispose() {
if (disposed_) return;
- done_ = true;
- cond_var_.notify_one();
+ {
+ std::lock_guard<std::mutex> lock(mutex_);
+ done_ = true;
+ cond_var_.notify_one();
+ }
thread_.join();
disposed_ = true;
}