fix tel ril crash

Signed-off-by: rsin <renxin20@h-partners.com>
This commit is contained in:
rsin 2024-11-18 11:39:00 +00:00 committed by Gitee
parent 1751bfcdd9
commit 23eb3ad17b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -22,7 +22,7 @@ namespace Telephony {
std::atomic_int TelRilBase::nextSerialId_(1);
std::unordered_map<int32_t, std::shared_ptr<TelRilRequest>> TelRilBase::requestMap_;
std::mutex TelRilBase::requestLock_;
std::mutex idleLock_;
std::mutex dealLock_;
std::shared_ptr<TelRilHandler> TelRilBase::handler_;
TelRilBase::TelRilBase(int32_t slotId, sptr<HDI::Ril::V1_3::IRil> rilInterface,
@ -34,13 +34,13 @@ TelRilBase::TelRilBase(int32_t slotId, sptr<HDI::Ril::V1_3::IRil> rilInterface,
void TelRilBase::ResetRilInterface(sptr<HDI::Ril::V1_3::IRil> rilInterface)
{
std::lock_guard<std::mutex> lock(idleLock_);
std::lock_guard<std::mutex> lock(dealLock_);
rilInterface_ = rilInterface;
}
sptr<HDI::Ril::V1_3::IRil> TelRilBase::GetRilInterface()
{
std::lock_guard<std::mutex> lock(idleLock_);
std::lock_guard<std::mutex> lock(dealLock_);
return rilInterface_;
}