summaryrefslogtreecommitdiff
path: root/uisimulator/sdl/kernel.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-09-09 01:59:07 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-09-09 01:59:07 +0000
commit0107dfc8276d73744bb097d643809205ef21d97b (patch)
tree17d434f51652d949d8167abaf85fe0eacd33612a /uisimulator/sdl/kernel.c
parent424750ea95409c6e78188aa47fe7a0f47d1127cb (diff)
downloadrockbox-0107dfc8276d73744bb097d643809205ef21d97b.tar.gz
rockbox-0107dfc8276d73744bb097d643809205ef21d97b.zip
UISIMULATOR: Give the host OS some needed context switching hints (which _is_ supposed to work on Linux - but I can't tell on VMWare - and does on Windows). I guess I'll know for sure soon. Give sleep() even more genuine behavior. Add some button driver sync with the rockbox threads that should have been there for some time - this is basically interrupt-like processing as any thread not in the kernel pool should be considered. Make the screendump work again by posting the request. Perhaps help out shutting down for some users but not in the way I'd prefer - to think about.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14646 a1c6a512-1295-4272-9138-f99709370657
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);