projects
/
openvswitch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0742399
)
queue: New function queue_is_empty().
author
Ben Pfaff
<blp@nicira.com>
Wed, 28 Oct 2009 18:10:22 +0000
(11:10 -0700)
committer
Ben Pfaff
<blp@nicira.com>
Wed, 4 Nov 2009 23:01:02 +0000
(15:01 -0800)
lib/queue.h
patch
|
blob
|
history
diff --git
a/lib/queue.h
b/lib/queue.h
index e94d20c468488e4d4d28661d088bbf516afed6e4..879f7a2d16ca5734679d30f9a9171185839385fd 100644
(file)
--- a/
lib/queue.h
+++ b/
lib/queue.h
@@
-17,6
+17,8
@@
#ifndef QUEUE_H
#define QUEUE_H 1
+#include <stdbool.h>
+
/* Packet queue. */
struct ovs_queue {
int n; /* Number of queued packets. */
@@
-31,4
+33,9
@@
void queue_advance_head(struct ovs_queue *, struct ofpbuf *next);
void queue_push_tail(struct ovs_queue *, struct ofpbuf *);
struct ofpbuf *queue_pop_head(struct ovs_queue *);
+static inline bool queue_is_empty(const struct ovs_queue *q)
+{
+ return q->n == 0;
+}
+
#endif /* queue.h */