diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2004-09-01 06:20:21 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2004-09-01 06:20:21 +0000 |
commit | 9872fead25247639eea33b40c2413907d9a6fbf4 (patch) | |
tree | fff1a96828c48765d5bf40ea31be811f7db00b7a /firmware | |
parent | 943ac26cf6fdc2676ca4ee8ffc5c25a4fb58da6e (diff) |
New kernel function: queue_clear()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5029 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/export/kernel.h | 1 | ||||
-rw-r--r-- | firmware/kernel.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h index 97994c41df..e3dc5ecaa9 100644 --- a/firmware/export/kernel.h +++ b/firmware/export/kernel.h @@ -72,6 +72,7 @@ extern void queue_wait(struct event_queue *q, struct event *ev); extern void queue_wait_w_tmo(struct event_queue *q, struct event *ev, int ticks); extern void queue_post(struct event_queue *q, int id, void *data); extern bool queue_empty(const struct event_queue* q); +void queue_clear(const struct event_queue* q); extern int queue_broadcast(int id, void *data); extern void mutex_init(struct mutex *m); diff --git a/firmware/kernel.c b/firmware/kernel.c index 2cb87ccbc9..6d9e2a8def 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c @@ -131,6 +131,12 @@ bool queue_empty(const struct event_queue* q) return ( q->read == q->write ); } +void queue_clear(const struct event_queue* q) +{ + q->read = 0; + q->write = 0; +} + int queue_broadcast(int id, void *data) { int i; |