X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=kern%2Fmsg.h;h=dbd73e839664c52a68af840c150126be2435623d;hb=ba39842cde8d33243188a2dc22baa8f1581b1c2d;hp=b87881b4b7fb982f0c2bc771f3bd50cbf3c47124;hpb=ea4ef51b306fde6480c03f72e81c4b31d51660f6;p=bertos.git diff --git a/kern/msg.h b/kern/msg.h index b87881b4..dbd73e83 100755 --- a/kern/msg.h +++ b/kern/msg.h @@ -16,15 +16,21 @@ * \author Bernardo Innocenti */ -/* - * $Log$ - * Revision 1.2 2004/08/14 19:37:57 rasky - * Merge da SC: macros.h, pool.h, BIT_CHANGE, nome dei processi, etc. - * - * Revision 1.1 2004/06/06 15:11:08 bernie - * Import into DevLib. - * - */ +/*#* + *#* $Log$ + *#* 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.2 2004/08/14 19:37:57 rasky + *#* Merge da SC: macros.h, pool.h, BIT_CHANGE, nome dei processi, etc. + *#* + *#* Revision 1.1 2004/06/06 15:11:08 bernie + *#* Import into DevLib. + *#* + *#*/ #ifndef KERN_MSG_H #define KERN_MSG_H @@ -67,6 +73,15 @@ INLINE Msg* msg_get(MsgPort* port) 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) {