mirror of
https://github.com/apache/nuttx.git
synced 2026-05-18 08:54:05 +08:00
mm/mm_heap/mm_sem.c: add getpid() return check in mm_trysemaphore()
Change-Id: Ifd56e3ccc22cf0a50f52e643b7a87aab0d0dca06 Signed-off-by: ligd <liguiding@fishsemi.com>
This commit is contained in:
@@ -174,6 +174,11 @@ int mm_trysemaphore(FAR struct mm_heap_s *heap)
|
||||
* 'else', albeit with a nonsensical PID value.
|
||||
*/
|
||||
|
||||
if (my_pid < 0)
|
||||
{
|
||||
return my_pid;
|
||||
}
|
||||
|
||||
/* Does the current task already hold the semaphore? Is the current
|
||||
* task actually running?
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user