diff --git a/sched/mqueue/mq_waitirq.c b/sched/mqueue/mq_waitirq.c index 138d1ceccb..76d2e236d7 100644 --- a/sched/mqueue/mq_waitirq.c +++ b/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 @@ -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/sched/semaphore/Make.defs b/sched/semaphore/Make.defs index 5349d58b4d..44b7e21d06 100644 --- a/sched/semaphore/Make.defs +++ b/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/sched/semaphore/sem_waitirq.c b/sched/semaphore/sem_waitirq.c index 49bed13ac7..5e9298f396 100644 --- a/sched/semaphore/sem_waitirq.c +++ b/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 * * 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); } -