Semaphores: sem_waitirq.c must be built when signals are disabled. That is because not handles not only the case of semaphore wait being awakened by a signal, but also the case with sem_timedwait.c when the semaphore wait is awakened by a timeout.

This commit is contained in:
Gregory Nutt 2014-12-28 15:03:12 -06:00
parent 78b755961f
commit 826f5516ff
3 changed files with 13 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -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);
}