New kernel function: queue_clear()

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5029 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2004-09-01 06:20:21 +00:00
parent 943ac26cf6
commit 9872fead25
2 changed files with 7 additions and 0 deletions

View file

@ -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_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 void queue_post(struct event_queue *q, int id, void *data);
extern bool queue_empty(const struct event_queue* q); 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 int queue_broadcast(int id, void *data);
extern void mutex_init(struct mutex *m); extern void mutex_init(struct mutex *m);

View file

@ -131,6 +131,12 @@ bool queue_empty(const struct event_queue* q)
return ( q->read == q->write ); 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 queue_broadcast(int id, void *data)
{ {
int i; int i;