summaryrefslogtreecommitdiff
path: root/uisimulator/sdl/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'uisimulator/sdl/kernel.c')
-rw-r--r--uisimulator/sdl/kernel.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/uisimulator/sdl/kernel.c b/uisimulator/sdl/kernel.c
index c82c6632cf..ff6c94933b 100644
--- a/uisimulator/sdl/kernel.c
+++ b/uisimulator/sdl/kernel.c
@@ -225,6 +225,15 @@ void queue_post(struct event_queue *q, long id, intptr_t data)
225 wakeup_thread(&q->thread); 225 wakeup_thread(&q->thread);
226} 226}
227 227
228/* Special thread-synced queue_post for button driver or any other preemptive sim thread */
229void queue_syncpost(struct event_queue *q, long id, intptr_t data)
230{
231 thread_sdl_lock();
232 /* No rockbox threads can be running here */
233 queue_post(q, id, data);
234 thread_sdl_unlock();
235}
236
228#ifdef HAVE_EXTENDED_MESSAGING_AND_NAME 237#ifdef HAVE_EXTENDED_MESSAGING_AND_NAME
229intptr_t queue_send(struct event_queue *q, long id, intptr_t data) 238intptr_t queue_send(struct event_queue *q, long id, intptr_t data)
230{ 239{
@@ -332,6 +341,17 @@ int queue_broadcast(long id, intptr_t data)
332 return num_queues; 341 return num_queues;
333} 342}
334 343
344/* Special thread-synced queue_broadcast for button driver or any other preemptive sim thread */
345int queue_syncbroadcast(long id, intptr_t data)
346{
347 int i;
348 thread_sdl_lock();
349 /* No rockbox threads can be running here */
350 i = queue_broadcast(id, data);
351 thread_sdl_unlock();
352 return i;
353}
354
335void yield(void) 355void yield(void)
336{ 356{
337 switch_thread(true, NULL); 357 switch_thread(true, NULL);