diff options
author | Jens Arnold <amiconn@rockbox.org> | 2007-04-14 09:47:47 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2007-04-14 09:47:47 +0000 |
commit | 0b7bb31453762f354af30210d1981f5dec3cdc19 (patch) | |
tree | 2af3ee3a98a3e9e2179421a367f12d2b97f7320d /uisimulator | |
parent | 9bfa237869ec3a75776926de7ffd4e7a1c4e03b9 (diff) |
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
Diffstat (limited to 'uisimulator')
-rw-r--r-- | uisimulator/sdl/kernel.c | 5 |
1 files changed, 5 insertions, 0 deletions
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; |