mirror of
https://github.com/openharmony/drivers_adapter.git
synced 2026-07-21 06:05:27 -04:00
fix: add lock protection when writing description members of remote objects
Signed-off-by: zhang <zhangfengxi@huawei.com>
This commit is contained in:
@@ -141,6 +141,8 @@ bool HdfRemoteServiceHolder::SetInterfaceDescriptor(const char *desc)
|
||||
HDF_LOGE("failed to set interface des, error on cover str8 to str16, %{public}s", desc);
|
||||
return false;
|
||||
}
|
||||
static std::mutex descMutex;
|
||||
std::lock_guard<std::mutex> lock(descMutex);
|
||||
(const_cast<std::u16string *>(&remote_->descriptor_))->assign(newDesc);
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user