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

Function _console_release

src/kservice.c:272–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

270}
271
272static void _console_release(void)
273{
274 rt_ubase_t level = rt_spin_lock_irqsave(&_syscon_lock);
275 rt_thread_t self_thread = rt_thread_self();
276 RT_UNUSED(self_thread);
277
278 RT_ASSERT(_pr_curr_user == self_thread);
279
280 _pr_curr_user_nested--;
281 if (!_pr_curr_user_nested)
282 {
283 _pr_curr_user = RT_NULL;
284
285#ifdef RT_USING_DEBUG
286 rt_exit_critical_safe(_syscon_lock.critical_level);
287 _syscon_lock.critical_level = _pr_critical_level;
288#else
289 rt_exit_critical();
290#endif
291 }
292 rt_spin_unlock_irqrestore(&_syscon_lock, level);
293}
294
295#define CONSOLE_TAKE _console_take()
296#define CONSOLE_RELEASE _console_release()

Callers

nothing calls this directly

Calls 5

rt_thread_selfFunction · 0.85
rt_spin_lock_irqsaveFunction · 0.70
rt_exit_critical_safeFunction · 0.70
rt_exit_criticalFunction · 0.70

Tested by

no test coverage detected