mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-01-22 01:30:35 -05:00
playlist: fix deadlock when calling playlist_restore() on certain timing
for example:
<audio> audio_thread
<audio> -audio_playback_handler
<audio> --audio_start_playback
<audio> ---audio_fill_file_buffer
<audio> ----playlist_peek
<main> -playlist_resume { playlist_write_lock(playlist) }
<main> --alloc_tempbuf
<main> ---core_alloc_ex
<main> ----buflib_alloc_ex
<main> -----buflib_compact_and_shrink
<main> ------playback.c:shrink_callback
<main> -------audio_queue_send(Q_AUDIO_STOP)
<main> (waiting for audio queue reply)
<audio> -----get_track_filename { playlist_write_lock(playlist) }
<audio> (waiting for playlist lock)
resolve this by not locking playlist until temporary buffer is allocated
Change-Id: I55a856780d17455b13e2515e096095ae0e9c86c2
This commit is contained in:
parent
ef47ffe250
commit
3892773bd7
1 changed files with 3 additions and 2 deletions
|
|
@ -3159,7 +3159,6 @@ int playlist_resume(void)
|
|||
|
||||
struct playlist_info* playlist = ¤t_playlist;
|
||||
dc_thread_stop(playlist);
|
||||
playlist_write_lock(playlist);
|
||||
|
||||
if (core_allocatable() < (1 << 10))
|
||||
talk_buffer_set_policy(TALK_BUFFER_LOOSE); /* back off voice buffer */
|
||||
|
|
@ -3172,9 +3171,11 @@ int playlist_resume(void)
|
|||
if (handle < 0)
|
||||
{
|
||||
splashf(HZ * 2, "%s(): OOM", __func__);
|
||||
goto out;
|
||||
return -1;
|
||||
}
|
||||
|
||||
playlist_write_lock(playlist);
|
||||
|
||||
/* align buffer for faster load times */
|
||||
buffer = core_get_data(handle);
|
||||
STORAGE_ALIGN_BUFFER(buffer, buflen);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue