Revert "sem: remove limitation of irq context when do sem_trywait"
This reverts commit 7c547b3ebd
.
This commit is contained in:
parent
1c2c0e4707
commit
b316611ef0
@ -80,13 +80,9 @@ bool mm_takesemaphore(FAR struct mm_heap_s *heap)
|
|||||||
|
|
||||||
if (up_interrupt_context())
|
if (up_interrupt_context())
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_DEBUG_MM
|
|
||||||
return _SEM_TRYWAIT(&heap->mm_semaphore) >= 0;
|
|
||||||
#else
|
|
||||||
/* Can't take semaphore in the interrupt handler */
|
/* Can't take semaphore in the interrupt handler */
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@ -69,11 +69,9 @@ int nxsem_trywait(FAR sem_t *sem)
|
|||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
#ifndef CONFIG_DEBUG_MM
|
|
||||||
/* This API should not be called from interrupt handlers */
|
/* This API should not be called from interrupt handlers */
|
||||||
|
|
||||||
DEBUGASSERT(sem != NULL && up_interrupt_context() == false);
|
DEBUGASSERT(sem != NULL && up_interrupt_context() == false);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (sem != NULL)
|
if (sem != NULL)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user