summaryrefslogtreecommitdiff
path: root/uisimulator/win32/kernel.c
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2003-04-19 13:15:33 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2003-04-19 13:15:33 +0000
commitc6fb565dd98d2da0cd5ba0e29b73c49617edcb9c (patch)
tree44ab870d30d5f5872a4bb35d49936185296616e3 /uisimulator/win32/kernel.c
parent6d522179dcbba409768a02845237967f39264e85 (diff)
most of UI sim patch 708460 from Magnus Holmgren, except the bitmap removal
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3571 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/win32/kernel.c')
-rw-r--r--uisimulator/win32/kernel.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/uisimulator/win32/kernel.c b/uisimulator/win32/kernel.c
index 150b8e42cc..567ed9ee39 100644
--- a/uisimulator/win32/kernel.c
+++ b/uisimulator/win32/kernel.c
@@ -56,6 +56,25 @@ void queue_wait(struct event_queue *q, struct event *ev)
*ev = q->events[(q->read++) & QUEUE_LENGTH_MASK];
}
+void queue_wait_w_tmo(struct event_queue *q, struct event *ev, int ticks)
+{
+ unsigned int timeout = current_tick + ticks;
+
+ while(q->read == q->write && TIME_BEFORE( current_tick, timeout ))
+ {
+ sleep(1);
+ }
+
+ if(q->read != q->write)
+ {
+ *ev = q->events[(q->read++) & QUEUE_LENGTH_MASK];
+ }
+ else
+ {
+ ev->id = SYS_TIMEOUT;
+ }
+}
+
void queue_post(struct event_queue *q, int id, void *data)
{
int wr;