修复扫描单例告警

Signed-off-by: wangjiaqiang <wangjiaqiang11@huawei.com>
This commit is contained in:
wangjiaqiang
2024-09-01 17:28:32 +08:00
parent ca8dbee29e
commit 7159648e57
2 changed files with 2 additions and 9 deletions
@@ -135,7 +135,6 @@ private:
static constexpr int RESUB_INTERVAL = 2;
static std::mutex mutex_;
static std::shared_ptr<DataObsMgrClient> instance_;
sptr<IDataObsMgr> dataObsManger_;
ConcurrentMap<sptr<IDataAbilityObserver>, std::list<Uri>> observers_;
@@ -24,7 +24,6 @@
namespace OHOS {
namespace AAFwk {
std::shared_ptr<DataObsMgrClient> DataObsMgrClient::instance_ = nullptr;
std::mutex DataObsMgrClient::mutex_;
class DataObsMgrClient::SystemAbilityStatusChangeListener
@@ -52,13 +51,8 @@ void DataObsMgrClient::SystemAbilityStatusChangeListener::OnAddSystemAbility(
std::shared_ptr<DataObsMgrClient> DataObsMgrClient::GetInstance()
{
if (instance_ == nullptr) {
std::lock_guard<std::mutex> lock_l(mutex_);
if (instance_ == nullptr) {
instance_ = std::make_shared<DataObsMgrClient>();
}
}
return instance_;
static std::shared_ptr<DataObsMgrClient> proxy = std::make_shared<DataObsMgrClient>();
return proxy;
}
DataObsMgrClient::DataObsMgrClient()