summaryrefslogtreecommitdiff
path: root/nuttx/sched
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/sched')
-rw-r--r--nuttx/sched/mqueue/mq_waitirq.c4
-rw-r--r--nuttx/sched/semaphore/Make.defs6
-rw-r--r--nuttx/sched/semaphore/sem_waitirq.c17
3 files changed, 13 insertions, 14 deletions
diff --git a/nuttx/sched/mqueue/mq_waitirq.c b/nuttx/sched/mqueue/mq_waitirq.c
index 138d1cecc..76d2e236d 100644
--- a/nuttx/sched/mqueue/mq_waitirq.c
+++ b/nuttx/sched/mqueue/mq_waitirq.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * sched/mqueue/mq_waitirq.c
+ * sched/mqueue/mq_waitirq.c
*
* Copyright (C) 2007-2009, 2011, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@@ -72,7 +72,7 @@
****************************************************************************/
/****************************************************************************
- * Name: sem_waitirq
+ * Name: mq_waitirq
*
* Description:
* This function is called when a signal or a timeout is received by a
diff --git a/nuttx/sched/semaphore/Make.defs b/nuttx/sched/semaphore/Make.defs
index 5349d58b4..44b7e21d0 100644
--- a/nuttx/sched/semaphore/Make.defs
+++ b/nuttx/sched/semaphore/Make.defs
@@ -34,11 +34,7 @@
############################################################################
CSRCS += sem_destroy.c sem_wait.c sem_trywait.c sem_timedwait.c
-CSRCS += sem_post.c sem_recover.c
-
-ifneq ($(CONFIG_DISABLE_SIGNALS),y)
-CSRCS += sem_waitirq.c
-endif
+CSRCS += sem_post.c sem_recover.c sem_waitirq.c
ifeq ($(CONFIG_PRIORITY_INHERITANCE),y)
CSRCS += sem_initialize.c sem_holder.c
diff --git a/nuttx/sched/semaphore/sem_waitirq.c b/nuttx/sched/semaphore/sem_waitirq.c
index 49bed13ac..5e9298f39 100644
--- a/nuttx/sched/semaphore/sem_waitirq.c
+++ b/nuttx/sched/semaphore/sem_waitirq.c
@@ -1,7 +1,7 @@
/****************************************************************************
* sched/semaphore/sem_waitirq.c
*
- * Copyright (C) 2007-2010 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2007-2010, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,7 +46,7 @@
#include "semaphore/semaphore.h"
/****************************************************************************
- * Definitions
+ * Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -73,10 +73,14 @@
* Name: sem_waitirq
*
* Description:
- * This function is called when a signal is received by a task that is
- * waiting on a semaphore. According to the POSIX spec, "...the calling
- * thread shall not return from the call to [sem_wait] until it either
- * locks the semaphore or the call is interrupted by a signal."
+ * This function is called when either:
+ *
+ * 1. A signal is received by a task that is waiting on a semaphore.
+ * According to the POSIX spec, "...the calling thread shall not return
+ * from the call to [sem_wait] until it either locks the semaphore or
+ * the call is interrupted by a signal."
+ * 2. From logic associated with sem_timedwait(). This function is called
+ * when the timeout elapses without receiving the semaphore.
*
* Parameters:
* wtcb - A pointer to the TCB of the task that is waiting on a
@@ -142,4 +146,3 @@ void sem_waitirq(FAR struct tcb_s *wtcb, int errcode)
irqrestore(saved_state);
}
-