mirror of
https://github.com/openharmony/drivers_adapter.git
synced 2026-07-20 21:59:19 -04:00
!583 fix: add lock protection when writing description members of remote objects
Merge pull request !583 from Zhang/master
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