MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _heap_lock

Function _heap_lock

src/kservice.c:706–719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

704}
705
706rt_inline rt_base_t _heap_lock(void)
707{
708#if defined(RT_USING_HEAP_ISR)
709 return rt_spin_lock_irqsave(&_heap_spinlock);
710#elif defined(RT_USING_MUTEX)
711 if (rt_thread_self())
712 return rt_mutex_take(&_lock, RT_WAITING_FOREVER);
713 else
714 return RT_EOK;
715#else
716 rt_enter_critical();
717 return RT_EOK;
718#endif
719}
720
721rt_inline void _heap_unlock(rt_base_t level)
722{

Callers 6

rt_mallocFunction · 0.85
rt_reallocFunction · 0.85
rt_freeFunction · 0.85
rt_memory_infoFunction · 0.85
rt_page_allocFunction · 0.85
rt_page_freeFunction · 0.85

Calls 4

rt_thread_selfFunction · 0.85
rt_mutex_takeFunction · 0.85
rt_spin_lock_irqsaveFunction · 0.70
rt_enter_criticalFunction · 0.70

Tested by

no test coverage detected