diff options
Diffstat (limited to 'nuttx/sched/sem_trywait.c')
-rw-r--r-- | nuttx/sched/sem_trywait.c | 7 |
1 files changed, 2 insertions, 5 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. */ |