mirror of
https://gitee.com/openharmony/window_window_manager
synced 2024-11-23 23:10:54 +00:00
!10595 appInfoMutex_读锁改为写锁
Merge pull request !10595 from tanliang/lock_fix
This commit is contained in:
commit
5142d30ca6
@ -74,7 +74,7 @@ void MultiInstanceManager::SetCurrentUserId(int32_t userId)
|
||||
|
||||
bool MultiInstanceManager::IsMultiInstance(const std::string& bundleName)
|
||||
{
|
||||
std::shared_lock<std::shared_mutex> lock(appInfoMutex_);
|
||||
std::unique_lock<std::shared_mutex> lock(appInfoMutex_);
|
||||
auto iter = appInfoMap_.find(bundleName);
|
||||
if (iter == appInfoMap_.end()) {
|
||||
AppExecFwk::ApplicationInfo appInfo;
|
||||
@ -91,7 +91,7 @@ bool MultiInstanceManager::IsMultiInstance(const std::string& bundleName)
|
||||
|
||||
uint32_t MultiInstanceManager::GetMaxInstanceCount(const std::string& bundleName)
|
||||
{
|
||||
std::shared_lock<std::shared_mutex> lock(appInfoMutex_);
|
||||
std::unique_lock<std::shared_mutex> lock(appInfoMutex_);
|
||||
auto iter = appInfoMap_.find(bundleName);
|
||||
if (iter == appInfoMap_.end()) {
|
||||
AppExecFwk::ApplicationInfo appInfo;
|
||||
|
Loading…
Reference in New Issue
Block a user