GUIDINGLI edited a comment on pull request #5539:
URL: https://github.com/apache/incubator-nuttx/pull/5539#issuecomment-1044165399


   Could you add a assert(0)  at mm_takesemaphore()  to see if there is someone 
who called it in IRQ context ?
   
   ```
    76 bool mm_takesemaphore(FAR struct mm_heap_s *heap)
    77 {
    78 #if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
    79   /* Check current environment */
    80 
    81   if (up_interrupt_context())
    82     {
    83 #if !defined(CONFIG_SMP) && defined(CONFIG_DEBUG_MM)
    84       int val;
    85 
    86       /* Check the semaphore value, if held by someone, then return 
false.
    87        * Else, we can take it, return true.
    88        */
    89 
    90       _SEM_GETVALUE(&heap->mm_semaphore, &val);
    91 
    92       return val > 0;
    93 #else
    94       /* Can't take semaphore in SMP interrupt handler */
    95 
    **_96       assert(0);_**                         **// here**
    97       return false;
    98 #endif
    99     }
   100   else
   101 #endif
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to