mirror of
https://github.com/openharmony/ability_ability_runtime.git
synced 2026-08-25 12:23:20 -04:00
@@ -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_;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user