mirror of
https://gitee.com/openharmony/startup_init
synced 2024-11-27 02:10:33 +00:00
Description:Code optimization
Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: lwx1281857 <linnanmu@h-partners.com>
This commit is contained in:
parent
efc7036e2c
commit
f99440f446
@ -147,7 +147,7 @@ void DeviceInfoService::OnStart(void)
|
||||
DINFO_LOGE("DeviceInfoService Publish failed");
|
||||
}
|
||||
threadStarted_ = true;
|
||||
std::thread(&DeviceInfoService::ThreadForUnloadSa, this).detach();
|
||||
std::thread([this] {this->ThreadForUnloadSa();});
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ void WatcherManagerKits::ResetService(const wptr<IRemoteObject> &remote)
|
||||
delete threadForReWatch_;
|
||||
}
|
||||
stop_ = false;
|
||||
threadForReWatch_ = new (std::nothrow)std::thread(&WatcherManagerKits::ReAddWatcher, this);
|
||||
threadForReWatch_ = new (std::nothrow)std::thread([this] {this->ReAddWatcher();});
|
||||
WATCHER_CHECK(threadForReWatch_ != nullptr, return, "Failed to create thread");
|
||||
}
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ void WatcherManager::RunLoop()
|
||||
void WatcherManager::StartLoop()
|
||||
{
|
||||
if (pRecvThread_ == nullptr) {
|
||||
pRecvThread_ = new (std::nothrow)std::thread(&WatcherManager::RunLoop, this);
|
||||
pRecvThread_ = new (std::nothrow)std::thread([this] {this->RunLoop();});
|
||||
WATCHER_CHECK(pRecvThread_ != nullptr, return, "Failed to create thread");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user