summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2023-01-16 11:55:59 +0000
committerAidan MacDonald <amachronic@protonmail.com>2023-01-16 16:57:23 +0000
commitaae34b2e7faead258e99e42bd199b329475eb17c (patch)
tree0ba966ec79961a94d9f373aec2d5b55d663daf6d /apps
parenta9b93bb4cd431c097223253ced6e39b0a3d87a28 (diff)
downloadrockbox-aae34b2e7faead258e99e42bd199b329475eb17c.tar.gz
rockbox-aae34b2e7faead258e99e42bd199b329475eb17c.zip
playlist: enable queue send
Apparently queue_send() silently falls back to queue_post() if sending isn't enabled. Doesn't seem like a good idea, as post and send are definitely *not* interchangeable! The playlist code relies on queue_send()'s blocking behavior to prevent the dircache thread from using potentially stale pointers. Change-Id: Ibf4b0def3bf9c96cb2fe80cd75043b7ce1dcf250
Diffstat (limited to 'apps')
-rw-r--r--apps/playlist.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 481524b9d4..4c21ea41f6 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -176,6 +176,7 @@ static struct playlist_info current_playlist;
176static bool dc_has_dirty_pointers = false; 176static bool dc_has_dirty_pointers = false;
177 177
178static struct event_queue playlist_queue SHAREDBSS_ATTR; 178static struct event_queue playlist_queue SHAREDBSS_ATTR;
179static struct queue_sender_list playlist_queue_sender_list SHAREDBSS_ATTR;
179static long playlist_stack[(DEFAULT_STACK_SIZE + 0x800)/sizeof(long)]; 180static long playlist_stack[(DEFAULT_STACK_SIZE + 0x800)/sizeof(long)];
180static const char dc_thread_playlist_name[] = "playlist cachectrl"; 181static const char dc_thread_playlist_name[] = "playlist cachectrl";
181 182
@@ -2086,11 +2087,14 @@ void playlist_init(void)
2086 playlist->max_playlist_size * sizeof(*playlist->dcfrefs), &ops); 2087 playlist->max_playlist_size * sizeof(*playlist->dcfrefs), &ops);
2087 playlist->dcfrefs = core_get_data(handle); 2088 playlist->dcfrefs = core_get_data(handle);
2088 dc_copy_filerefs(playlist->dcfrefs, NULL, playlist->max_playlist_size); 2089 dc_copy_filerefs(playlist->dcfrefs, NULL, playlist->max_playlist_size);
2089 create_thread(dc_thread_playlist, playlist_stack, sizeof(playlist_stack), 2090 unsigned int playlist_thread_id =
2090 0, dc_thread_playlist_name IF_PRIO(, PRIORITY_BACKGROUND) 2091 create_thread(dc_thread_playlist, playlist_stack, sizeof(playlist_stack),
2091 IF_COP(, CPU)); 2092 0, dc_thread_playlist_name IF_PRIO(, PRIORITY_BACKGROUND)
2093 IF_COP(, CPU));
2092 2094
2093 queue_init(&playlist_queue, true); 2095 queue_init(&playlist_queue, true);
2096 queue_enable_queue_send(&playlist_queue,
2097 &playlist_queue_sender_list, playlist_thread_id);
2094#endif /* HAVE_DIRCACHE */ 2098#endif /* HAVE_DIRCACHE */
2095} 2099}
2096 2100