diff options
author | Jim-Nexty <35795928+zhouxin627@users.noreply.github.com> | 2020-02-11 01:30:51 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-10 11:30:51 -0500 |
commit | db92580aa80c4caee7e8907274aec22660ea552d (patch) | |
tree | a9f34e13da0cf6b9dfca3b48f5632768a2d27d13 | |
parent | 3dfaccc21d83621eff5d122f58bd3709fc40737d (diff) | |
download | sdl_core-db92580aa80c4caee7e8907274aec22660ea552d.tar.gz |
Fix for Bug:Deadlock happens during video streaming (#3231)
Co-authored-by: Collin <iCollin@users.noreply.github.com>
-rw-r--r-- | src/components/application_manager/src/application_impl.cc | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/src/components/application_manager/src/application_impl.cc b/src/components/application_manager/src/application_impl.cc index f44a63d5d6..11d038fee2 100644 --- a/src/components/application_manager/src/application_impl.cc +++ b/src/components/application_manager/src/application_impl.cc @@ -645,23 +645,27 @@ void ApplicationImpl::WakeUpStreaming( sync_primitives::AutoLock lock(streaming_stop_lock_); if (ServiceType::kMobileNav == service_type) { - sync_primitives::AutoLock lock(video_streaming_suspended_lock_); - if (video_streaming_suspended_) { - application_manager_.OnAppStreaming(app_id(), service_type, true); - application_manager_.ProcessOnDataStreamingNotification( - service_type, app_id(), true); - video_streaming_suspended_ = false; + { // reduce the range of video_streaming_suspended_lock_ + sync_primitives::AutoLock lock(video_streaming_suspended_lock_); + if (video_streaming_suspended_) { + application_manager_.OnAppStreaming(app_id(), service_type, true); + application_manager_.ProcessOnDataStreamingNotification( + service_type, app_id(), true); + video_streaming_suspended_ = false; + } } video_stream_suspend_timer_.Start( timer_len == 0 ? video_stream_suspend_timeout_ : timer_len, timer::kPeriodic); } else if (ServiceType::kAudio == service_type) { - sync_primitives::AutoLock lock(audio_streaming_suspended_lock_); - if (audio_streaming_suspended_) { - application_manager_.OnAppStreaming(app_id(), service_type, true); - application_manager_.ProcessOnDataStreamingNotification( - service_type, app_id(), true); - audio_streaming_suspended_ = false; + { // reduce the range of audio_streaming_suspended_lock_ + sync_primitives::AutoLock lock(audio_streaming_suspended_lock_); + if (audio_streaming_suspended_) { + application_manager_.OnAppStreaming(app_id(), service_type, true); + application_manager_.ProcessOnDataStreamingNotification( + service_type, app_id(), true); + audio_streaming_suspended_ = false; + } } audio_stream_suspend_timer_.Start( timer_len == 0 ? audio_stream_suspend_timeout_ : timer_len, |