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
@ -174,6 +174,11 @@ int mm_trysemaphore(FAR struct mm_heap_s *heap)
|
|||||||
* 'else', albeit with a nonsensical PID value.
|
* '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
|
/* Does the current task already hold the semaphore? Is the current
|
||||||
* task actually running?
|
* task actually running?
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user