mirror of
https://github.com/openharmony/drivers_adapter.git
synced 2026-07-19 18:23:38 -04:00
!585 fix: add lock protection when writing description members of remote objects
Merge pull request !585 from Zhang/OpenHarmony-3.2-Beta1
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