mm/tlfs: Replace the critical section with spin lock

Base on discusion: https://github.com/apache/nuttx/issues/10981

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-10-21 17:18:57 +08:00 committed by Petro Karashchenko
parent 949d01be51
commit 08bae13624
1 changed files with 4 additions and 4 deletions

View File

@ -173,12 +173,12 @@ static void add_delaylist(FAR struct mm_heap_s *heap, FAR void *mem)
/* Delay the deallocation until a more appropriate time. */
flags = enter_critical_section();
flags = spin_lock_irqsave(NULL);
tmp->flink = heap->mm_delaylist[up_cpu_index()];
heap->mm_delaylist[up_cpu_index()] = tmp;
leave_critical_section(flags);
spin_unlock_irqrestore(NULL, flags);
#endif
}
@ -194,12 +194,12 @@ static void free_delaylist(FAR struct mm_heap_s *heap)
/* Move the delay list to local */
flags = enter_critical_section();
flags = spin_lock_irqsave(NULL);
tmp = heap->mm_delaylist[up_cpu_index()];
heap->mm_delaylist[up_cpu_index()] = NULL;
leave_critical_section(flags);
spin_unlock_irqrestore(NULL, flags);
/* Test if the delayed is empty */