projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add missing header.
[bertos.git]
/
kern
/
msg.h
diff --git
a/kern/msg.h
b/kern/msg.h
index d9b06707cc37d62be7427eaf2824650cc43c4664..b808602ac132ef2d9cd187e40f4a7525634d35da 100755
(executable)
--- a/
kern/msg.h
+++ b/
kern/msg.h
@@
-18,6
+18,12
@@
/*#*
*#* $Log$
/*#*
*#* $Log$
+ *#* Revision 1.5 2004/11/28 23:20:25 bernie
+ *#* Remove obsolete INITLIST macro.
+ *#*
+ *#* Revision 1.4 2004/10/19 08:22:09 bernie
+ *#* msg_peek(): New function.
+ *#*
*#* Revision 1.3 2004/08/25 14:12:09 rasky
*#* Aggiornato il comment block dei log RCS
*#*
*#* Revision 1.3 2004/08/25 14:12:09 rasky
*#* Aggiornato il comment block dei log RCS
*#*
@@
-53,7
+59,7
@@
typedef struct Msg
/*! Initialize a message port */
INLINE void msg_initPort(MsgPort* port, Event event)
{
/*! Initialize a message port */
INLINE void msg_initPort(MsgPort* port, Event event)
{
-
INITLIS
T(&port->queue);
+
LIST_INI
T(&port->queue);
port->evn = event;
}
port->evn = event;
}
@@
-70,6
+76,15
@@
INLINE Msg* msg_get(MsgPort* port)
return (Msg*)REMHEAD(&port->queue);
}
return (Msg*)REMHEAD(&port->queue);
}
+/* Peek the first message in the queue of \a port, or NULL if the port is empty */
+INLINE Msg *msg_peek(MsgPort *port)
+{
+ if (ISLISTEMPTY(&port->queue))
+ return NULL;
+
+ return (Msg *)port->queue.head;
+}
+
/*! Send back (reply) \a msg to its sender */
INLINE void msg_reply(Msg* msg)
{
/*! Send back (reply) \a msg to its sender */
INLINE void msg_reply(Msg* msg)
{