From 0107dfc8276d73744bb097d643809205ef21d97b Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sun, 9 Sep 2007 01:59:07 +0000 Subject: 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 --- uisimulator/sdl/kernel.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'uisimulator/sdl/kernel.c') 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) wakeup_thread(&q->thread); } +/* Special thread-synced queue_post for button driver or any other preemptive sim thread */ +void queue_syncpost(struct event_queue *q, long id, intptr_t data) +{ + thread_sdl_lock(); + /* No rockbox threads can be running here */ + queue_post(q, id, data); + thread_sdl_unlock(); +} + #ifdef HAVE_EXTENDED_MESSAGING_AND_NAME intptr_t queue_send(struct event_queue *q, long id, intptr_t data) { @@ -332,6 +341,17 @@ int queue_broadcast(long id, intptr_t data) return num_queues; } +/* Special thread-synced queue_broadcast for button driver or any other preemptive sim thread */ +int queue_syncbroadcast(long id, intptr_t data) +{ + int i; + thread_sdl_lock(); + /* No rockbox threads can be running here */ + i = queue_broadcast(id, data); + thread_sdl_unlock(); + return i; +} + void yield(void) { switch_thread(true, NULL); -- cgit v1.2.3