summaryrefslogtreecommitdiff
path: root/nuttx/sched
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/sched')
-rw-r--r--nuttx/sched/sem_trywait.c7
-rw-r--r--nuttx/sched/sem_wait.c7
2 files changed, 3 insertions, 11 deletions
diff --git a/nuttx/sched/sem_trywait.c b/nuttx/sched/sem_trywait.c
index dc65f8f58..e634e1781 100644
--- a/nuttx/sched/sem_trywait.c
+++ b/nuttx/sched/sem_trywait.c
@@ -102,12 +102,9 @@ int sem_trywait(sem_t *sem)
irqstate_t saved_state;
int ret = ERROR;
- if (up_interrupt_context())
- {
- /* We do not want to set the errno in this case */
+ /* This API should not be called from interrupt handlers */
- return ERROR;
- }
+ DEBUGASSERT(!up_interrupt_context())
/* Assume any errors reported are due to invalid arguments. */
diff --git a/nuttx/sched/sem_wait.c b/nuttx/sched/sem_wait.c
index 4d82dd41a..8734dc1f7 100644
--- a/nuttx/sched/sem_wait.c
+++ b/nuttx/sched/sem_wait.c
@@ -105,12 +105,7 @@ int sem_wait(sem_t *sem)
/* This API should not be called from interrupt handlers */
- if (up_interrupt_context())
- {
- /* We do not want to set the errno in this case */
-
- return ERROR;
- }
+ DEBUGASSERT(!up_interrupt_context())
/* Assume any errors reported are due to invalid arguments. */