mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 04:19:37 +08:00
mm/mm_heap/mm_initialize.c: add sem lock to mm_addregion()
Change-Id: I4a72e36fcd4504c0d8e671fe2243b14764db3b35
This commit is contained in:
@@ -82,6 +82,8 @@ void mm_addregion(FAR struct mm_heap_s *heap, FAR void *heapstart,
|
|||||||
DEBUGASSERT(heapsize <= MMSIZE_MAX + 1);
|
DEBUGASSERT(heapsize <= MMSIZE_MAX + 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
mm_takesemaphore(heap);
|
||||||
|
|
||||||
/* Adjust the provide heap start and size so that they are both aligned
|
/* Adjust the provide heap start and size so that they are both aligned
|
||||||
* with the MM_MIN_CHUNK size.
|
* with the MM_MIN_CHUNK size.
|
||||||
*/
|
*/
|
||||||
@@ -127,6 +129,8 @@ void mm_addregion(FAR struct mm_heap_s *heap, FAR void *heapstart,
|
|||||||
/* Add the single, large free node to the nodelist */
|
/* Add the single, large free node to the nodelist */
|
||||||
|
|
||||||
mm_addfreechunk(heap, node);
|
mm_addfreechunk(heap, node);
|
||||||
|
|
||||||
|
mm_givesemaphore(heap);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user