mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 04:52:02 +08:00
libs/libc/semaphore: Fix DEBUGASSERTS
The DEBUGASSERTS in nxsem_wait and nxsem_trywait were non-functional, they didn't check anything. Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This commit is contained in:
committed by
Xiang Xiao
parent
1e8977c079
commit
300992203a
@@ -106,13 +106,12 @@ int sem_trywait(FAR sem_t *sem)
|
||||
|
||||
int nxsem_trywait(FAR sem_t *sem)
|
||||
{
|
||||
DEBUGASSERT(sem != NULL);
|
||||
|
||||
/* This API should not be called from the idleloop or interrupt */
|
||||
|
||||
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
|
||||
DEBUGASSERT(!OSINIT_IDLELOOP() || !sched_idletask() ||
|
||||
up_interrupt_context());
|
||||
DEBUGASSERT(sem != NULL);
|
||||
DEBUGASSERT(!up_interrupt_context());
|
||||
DEBUGASSERT(!OSINIT_IDLELOOP() || !sched_idletask());
|
||||
#endif
|
||||
|
||||
/* We don't do atomic fast path in case of LIBC_ARCH_ATOMIC because that
|
||||
|
||||
@@ -134,13 +134,12 @@ errout_with_cancelpt:
|
||||
|
||||
int nxsem_wait(FAR sem_t *sem)
|
||||
{
|
||||
DEBUGASSERT(sem != NULL);
|
||||
|
||||
/* This API should not be called from the idleloop or interrupt */
|
||||
|
||||
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
|
||||
DEBUGASSERT(!OSINIT_IDLELOOP() || !sched_idletask() ||
|
||||
up_interrupt_context());
|
||||
DEBUGASSERT(sem != NULL);
|
||||
DEBUGASSERT(!up_interrupt_context());
|
||||
DEBUGASSERT(!OSINIT_IDLELOOP() || !sched_idletask());
|
||||
#endif
|
||||
|
||||
/* We don't do atomic fast path in case of LIBC_ARCH_ATOMIC because that
|
||||
|
||||
Reference in New Issue
Block a user