From c6fb565dd98d2da0cd5ba0e29b73c49617edcb9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Hohensohn?= Date: Sat, 19 Apr 2003 13:15:33 +0000 Subject: 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 --- uisimulator/win32/kernel.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'uisimulator/win32/kernel.c') 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; -- cgit v1.2.3