diff --git a/services/dbms/include/distributed_data_storage.h b/services/dbms/include/distributed_data_storage.h index 0f7596a309063022df755e9a82de1ba8b774b9a6..11fd9267f2038c8f310dfcbf86864abb6c3ab9f4 100644 --- a/services/dbms/include/distributed_data_storage.h +++ b/services/dbms/include/distributed_data_storage.h @@ -49,7 +49,7 @@ private: int32_t GetUdidByNetworkId(const std::string &networkId, std::string &udid); bool InnerSaveStorageDistributeInfo(const DistributedBundleInfo &distributedBundleInfo); private: - static std::recursive_mutex mutex_; + static std::mutex mutex_; static std::shared_ptr instance_; const DistributedKv::AppId appId_ {Constants::APP_ID}; diff --git a/services/dbms/src/distributed_data_storage.cpp b/services/dbms/src/distributed_data_storage.cpp index 6d1dc6f8731a4d7d2ba547f4640225237059a2a4..3df550c3d92a8cc0e3db630408ddd90869894526 100644 --- a/services/dbms/src/distributed_data_storage.cpp +++ b/services/dbms/src/distributed_data_storage.cpp @@ -38,12 +38,12 @@ const uint32_t DEVICE_UDID_LENGTH = 65; } // namespace std::shared_ptr DistributedDataStorage::instance_ = nullptr; -std::recursive_mutex DistributedDataStorage::mutex_; +std::mutex DistributedDataStorage::mutex_; std::shared_ptr DistributedDataStorage::GetInstance() { if (instance_ == nullptr) { - std::lock_guard lock_l(mutex_); + std::lock_guard lock_l(mutex_); if (instance_ == nullptr) { instance_ = std::make_shared(); }