diff options
Diffstat (limited to 'src/mm_radio_priv_hal.c')
-rw-r--r-- | src/mm_radio_priv_hal.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mm_radio_priv_hal.c b/src/mm_radio_priv_hal.c index b11bc62..29f990a 100644 --- a/src/mm_radio_priv_hal.c +++ b/src/mm_radio_priv_hal.c @@ -795,6 +795,8 @@ int _mmradio_seek(mm_radio_t *radio, MMRadioSeekDirectionType direction) radio->seek_unmute = true; } + MMRADIO_THREAD_LOCK(p_thread); + MMRADIO_LOG_INFO("trying to seek. direction[0:UP/1:DOWN) %d", direction); radio->seek_direction = direction; p_thread->is_running = true; @@ -802,6 +804,8 @@ int _mmradio_seek(mm_radio_t *radio, MMRadioSeekDirectionType direction) MMRADIO_THREAD_SIGNAL(p_thread); + MMRADIO_THREAD_UNLOCK(p_thread); + MMRADIO_LOG_FLEAVE(); return MM_ERROR_NONE; @@ -879,11 +883,14 @@ int _mmradio_start_scan(mm_radio_t *radio) } else { MMRADIO_LOG_DEBUG("radio prepared and opened"); } + MMRADIO_THREAD_LOCK(p_thread); p_thread->is_running = true; MMRADIO_THREAD_SIGNAL(p_thread); + MMRADIO_THREAD_UNLOCK(p_thread); + MMRADIO_SET_STATE(radio, MM_RADIO_STATE_SCANNING); MMRADIO_LOG_FLEAVE(); @@ -1897,5 +1904,4 @@ static void __mmradio_close_radio_device(mm_radio_t *radio) MMRADIO_LOG_ERROR("resource manager commit fail"); radio->is_ready = false; - -}
\ No newline at end of file +} |