From 0b7bb31453762f354af30210d1981f5dec3cdc19 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sat, 14 Apr 2007 09:47:47 +0000 Subject: Simplification, queue pointers don't wrap (except at INT_MAX, but the calculation is still correct in this case). Implemented queue_count() for the simulator. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13154 a1c6a512-1295-4272-9138-f99709370657 --- uisimulator/sdl/kernel.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'uisimulator') diff --git a/uisimulator/sdl/kernel.c b/uisimulator/sdl/kernel.c index 8918ff7e12..98d509f6a6 100644 --- a/uisimulator/sdl/kernel.c +++ b/uisimulator/sdl/kernel.c @@ -281,6 +281,11 @@ void queue_remove_from_head(struct event_queue *q, long id) set_irq_level(oldlevel); } +int queue_count(const struct event_queue *q) +{ + return q->write - q->read; +} + void switch_thread(bool save_context, struct thread_entry **blocked_list) { (void)save_context; -- cgit v1.2.3