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

Function sys_enter_critical

components/lwp/lwp_syscall.c:4345–4348  ·  view source on GitHub ↗

* @brief Enters a critical section to prevent context switching or interrupts. * * @note Critical sections are typically used to protect shared resources or perform * non-interruptible operations. Ensure to exit the critical section as soon as * possible by calling `sys_exit_critical` to avoid system performance degradation * or deadlocks. * * @warning Failure to exit a cr

Source from the content-addressed store, hash-verified

4343 * `sys_exit_critical` call) may lead to system instability or a complete halt.
4344 */
4345void sys_enter_critical(void)
4346{
4347 rt_sem_take(&critical_lock, RT_WAITING_FOREVER);
4348}
4349
4350/**
4351 * @brief Exits a critical section and restores the system's previous state.

Callers

nothing calls this directly

Calls 1

rt_sem_takeFunction · 0.85

Tested by

no test coverage detected