From: Hwankyu Jhun Date: Wed, 6 Nov 2024 11:08:45 +0000 (+0900) Subject: Add a missing mutex lock X-Git-Tag: accepted/tizen/unified/20241108.105508~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6433da6a2005ab739e9672ea0ec1532b37f95ff9;p=platform%2Fcore%2Fappfw%2Frpc-port.git Add a missing mutex lock Before using condition variable, we should lock the mutex to avoid a timing issue. Change-Id: I78c22d275a3dfc08087ec722cb9d0c53d08c3c19 Signed-off-by: Hwankyu Jhun --- diff --git a/src/rpc-port/cynara_thread.cc b/src/rpc-port/cynara_thread.cc index 0145840..fbb2ee8 100644 --- 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 lock(mutex_); + done_ = true; + cond_var_.notify_one(); + } thread_.join(); disposed_ = true; }