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/sdl/kernel.c | |
parent | 9bfa237869ec3a75776926de7ffd4e7a1c4e03b9 (diff) | |
download | rockbox-0b7bb31453762f354af30210d1981f5dec3cdc19.tar.gz rockbox-0b7bb31453762f354af30210d1981f5dec3cdc19.zip |
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/sdl/kernel.c')
-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) | |||
281 | set_irq_level(oldlevel); | 281 | set_irq_level(oldlevel); |
282 | } | 282 | } |
283 | 283 | ||
284 | int queue_count(const struct event_queue *q) | ||
285 | { | ||
286 | return q->write - q->read; | ||
287 | } | ||
288 | |||
284 | void switch_thread(bool save_context, struct thread_entry **blocked_list) | 289 | void switch_thread(bool save_context, struct thread_entry **blocked_list) |
285 | { | 290 | { |
286 | (void)save_context; | 291 | (void)save_context; |