mirror of
https://github.com/apache/nuttx.git
synced 2026-08-07 21:47:17 +00: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:
parent
afe08b666c
commit
78eb9f73dd
1 changed files with 5 additions and 0 deletions
|
|
@ -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?
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue