summaryrefslogtreecommitdiff
path: root/nuttx/sched/mq_rcvinternal.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-01-30 14:01:22 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-01-30 14:01:22 +0000
commite674da72e287079bed6af67b3ab1c47896e4c5e0 (patch)
treef996771a3003d34ba59916139fd0192e0af7fc67 /nuttx/sched/mq_rcvinternal.c
parentdc8be32e82d78481cd269b4e60d025e2e2357db7 (diff)
downloadpx4-nuttx-e674da72e287079bed6af67b3ab1c47896e4c5e0.tar.gz
px4-nuttx-e674da72e287079bed6af67b3ab1c47896e4c5e0.tar.bz2
px4-nuttx-e674da72e287079bed6af67b3ab1c47896e4c5e0.zip
Cosmetic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@589 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/mq_rcvinternal.c')
-rw-r--r--nuttx/sched/mq_rcvinternal.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/nuttx/sched/mq_rcvinternal.c b/nuttx/sched/mq_rcvinternal.c
index 853ac0bc1..744094322 100644
--- a/nuttx/sched/mq_rcvinternal.c
+++ b/nuttx/sched/mq_rcvinternal.c
@@ -1,7 +1,7 @@
-/************************************************************
- * mq_rcvinternal.c
+/****************************************************************************
+ * sched/mq_rcvinternal.c
*
- * Copyright (C) 2007 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -14,7 +14,7 @@
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
- * 3. Neither the name Gregory Nutt nor the names of its contributors may be
+ * 3. Neither the name NuttX nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
@@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Included Files
- ************************************************************/
+ ****************************************************************************/
#include <sys/types.h>
#include <fcntl.h> /* O_NONBLOCK */
@@ -49,31 +49,31 @@
#include "os_internal.h"
#include "mq_internal.h"
-/************************************************************
+/****************************************************************************
* Definitions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Type Declarations
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Global Variables
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Variables
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Private Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Public Functions
- ************************************************************/
+ ****************************************************************************/
-/************************************************************
+/****************************************************************************
* Name: mq_verifyreceive
*
* Description:
@@ -97,7 +97,7 @@
*
* Assumptions:
*
- ************************************************************/
+ ****************************************************************************/
int mq_verifyreceive(mqd_t mqdes, void *msg, size_t msglen)
{
@@ -124,7 +124,7 @@ int mq_verifyreceive(mqd_t mqdes, void *msg, size_t msglen)
return OK;
}
-/************************************************************
+/****************************************************************************
* Function: mq_waitreceive
*
* Description:
@@ -150,7 +150,7 @@ int mq_verifyreceive(mqd_t mqdes, void *msg, size_t msglen)
* - For mq_timedreceive, setting of the timer and this wait
* must be atomic.
*
- ************************************************************/
+ ****************************************************************************/
FAR mqmsg_t *mq_waitreceive(mqd_t mqdes)
{
@@ -166,13 +166,13 @@ FAR mqmsg_t *mq_waitreceive(mqd_t mqdes)
while ((rcvmsg = (FAR mqmsg_t*)sq_remfirst(&msgq->msglist)) == NULL)
{
- /* Should we block until there the above condition has been
- * satisfied?
+ /* The queue is empty! Should we block until there the above condition
+ * has been satisfied?
*/
- if (!(mqdes->oflags & O_NONBLOCK))
+ if ((mqdes->oflags & O_NONBLOCK) == 0)
{
- /* Block and try again */
+ /* Yes.. Block and try again */
rtcb = (FAR _TCB*)g_readytorun.head;
rtcb->msgwaitq = msgq;
@@ -214,7 +214,7 @@ FAR mqmsg_t *mq_waitreceive(mqd_t mqdes)
return rcvmsg;
}
-/************************************************************
+/****************************************************************************
* Function: mq_doreceive
*
* Description:
@@ -245,7 +245,7 @@ FAR mqmsg_t *mq_waitreceive(mqd_t mqdes)
* message queue
* - Pre-emption should be disabled throughout this call.
*
- ************************************************************/
+ ****************************************************************************/
ssize_t mq_doreceive(mqd_t mqdes, mqmsg_t *mqmsg, void *ubuffer, int *prio)
{