mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 06:42:32 +08:00
sem: remove limitation of irq context when do sem_trywait
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
@@ -80,9 +80,13 @@ bool mm_takesemaphore(FAR struct mm_heap_s *heap)
|
||||
|
||||
if (up_interrupt_context())
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_MM
|
||||
return _SEM_TRYWAIT(&heap->mm_semaphore) >= 0;
|
||||
#else
|
||||
/* Can't take semaphore in the interrupt handler */
|
||||
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user