forked from len0rd/rockbox
Added queue_empty()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@658 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
82e6a07298
commit
29f80283e9
2 changed files with 8 additions and 0 deletions
|
@ -94,6 +94,11 @@ void queue_post(struct event_queue *q, int id, void *data)
|
||||||
set_irq_level(oldlevel);
|
set_irq_level(oldlevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool queue_empty(struct event_queue* q)
|
||||||
|
{
|
||||||
|
return ( q->read == q->write );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Timer tick
|
* Timer tick
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
#ifndef _KERNEL_H_
|
#ifndef _KERNEL_H_
|
||||||
#define _KERNEL_H_
|
#define _KERNEL_H_
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
/* wrap-safe macros for tick comparison */
|
/* wrap-safe macros for tick comparison */
|
||||||
#define TIME_AFTER(a,b) ((long)(b) - (long)(a) < 0)
|
#define TIME_AFTER(a,b) ((long)(b) - (long)(a) < 0)
|
||||||
#define TIME_BEFORE(a,b) TIME_AFTER(b,a)
|
#define TIME_BEFORE(a,b) TIME_AFTER(b,a)
|
||||||
|
@ -60,6 +62,7 @@ int tick_remove_task(void (*f)(void));
|
||||||
extern void queue_init(struct event_queue *q);
|
extern void queue_init(struct event_queue *q);
|
||||||
extern void queue_wait(struct event_queue *q, struct event *ev);
|
extern void queue_wait(struct event_queue *q, struct event *ev);
|
||||||
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(struct event_queue* q);
|
||||||
|
|
||||||
extern void mutex_init(struct mutex *m);
|
extern void mutex_init(struct mutex *m);
|
||||||
extern void mutex_lock(struct mutex *m);
|
extern void mutex_lock(struct mutex *m);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue