Merge pull request !6695 from zhuhan/1013
This commit is contained in:
openharmony_ci
2023-10-25 01:14:15 +00:00
committed by Gitee
2 changed files with 4 additions and 0 deletions
@@ -16,6 +16,7 @@
#ifndef OHOS_ABILITY_RUNTIME_PENDING_WANT_KEY_H
#define OHOS_ABILITY_RUNTIME_PENDING_WANT_KEY_H
#include <mutex>
#include <vector>
#include <string>
@@ -64,6 +65,7 @@ private:
int32_t flags_ = {};
int32_t code_ = {};
int32_t userId_ = {};
std::mutex wantsInfosMutex_;
};
} // namespace AAFwk
} // namespace OHOS
@@ -50,6 +50,7 @@ void PendingWantKey::SetRequestResolvedType(const std::string &requestResolvedTy
void PendingWantKey::SetAllWantsInfos(const std::vector<WantsInfo> &allWantsInfos)
{
std::lock_guard<std::mutex> lock(wantsInfosMutex_);
allWantsInfos_ = allWantsInfos;
}
@@ -105,6 +106,7 @@ std::string PendingWantKey::GetRequestResolvedType()
std::vector<WantsInfo> PendingWantKey::GetAllWantsInfos()
{
std::lock_guard<std::mutex> lock(wantsInfosMutex_);
return allWantsInfos_;
}