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

Function _thread_detach

src/thread.c:496–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494RTM_EXPORT(rt_thread_detach);
495
496static rt_err_t _thread_detach(rt_thread_t thread)
497{
498 rt_err_t error;
499 rt_base_t critical_level;
500
501 /**
502 * forbid scheduling on current core before returning since current thread
503 * may be detached from scheduler.
504 */
505 critical_level = rt_enter_critical();
506
507 error = rt_thread_close(thread);
508
509 _thread_detach_from_mutex(thread);
510
511 /* insert to defunct thread list */
512 rt_thread_defunct_enqueue(thread);
513
514 rt_exit_critical_safe(critical_level);
515 return error;
516}
517
518#ifdef RT_USING_HEAP
519/**

Callers 2

rt_thread_detachFunction · 0.85
rt_thread_deleteFunction · 0.85

Calls 5

rt_thread_closeFunction · 0.85
rt_enter_criticalFunction · 0.70
rt_exit_critical_safeFunction · 0.70

Tested by

no test coverage detected