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

Function rt_spin_lock_irqsave

src/cpu_up.c:73–81  ·  view source on GitHub ↗

* @brief This function will disable the local interrupt and then lock the spinlock, will lock the thread scheduler. * * @note If the spinlock is locked, the current CPU will keep polling the spinlock state * until the spinlock is unlocked. * * @param lock is a pointer to the spinlock. * * @return Return current cpu interrupt status. */

Source from the content-addressed store, hash-verified

71 * @return Return current cpu interrupt status.
72 */
73rt_base_t rt_spin_lock_irqsave(struct rt_spinlock *lock)
74{
75 rt_base_t level;
76 RT_UNUSED(lock);
77 level = rt_hw_interrupt_disable();
78 rt_enter_critical();
79 RT_SPIN_LOCK_DEBUG(lock);
80 return level;
81}
82
83/**
84 * @brief This function will unlock the spinlock and then restore current cpu interrupt status, will unlock the thread scheduler.

Callers 15

_console_takeFunction · 0.70
_console_releaseFunction · 0.70
_heap_lockFunction · 0.70
rt_sem_detachFunction · 0.70
rt_sem_deleteFunction · 0.70
_rt_sem_takeFunction · 0.70
rt_sem_releaseFunction · 0.70
rt_sem_controlFunction · 0.70
rt_event_detachFunction · 0.70
rt_event_sendFunction · 0.70
_rt_event_recvFunction · 0.70

Calls 2

rt_enter_criticalFunction · 0.70
rt_hw_interrupt_disableFunction · 0.50

Tested by

no test coverage detected