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

Function _clear_child_tid

components/lwp/lwp_pid.c:832–843  ·  view source on GitHub ↗

* @brief Clear child thread ID notification for parent process * * @param[in,out] thread Thread whose child tid needs to be cleared * * @note This function performs the following operations: * - Checks if clear_child_tid pointer is set * - Writes 0 to user-space memory location if set * - Wakes any futex waiters on that location * - Clears the thread's clear_child_t

Source from the content-addressed store, hash-verified

830 * - Clears the thread's clear_child_tid pointer
831 */
832rt_inline void _clear_child_tid(rt_thread_t thread)
833{
834 if (thread->clear_child_tid)
835 {
836 int t = 0;
837 int *clear_child_tid = thread->clear_child_tid;
838
839 thread->clear_child_tid = RT_NULL;
840 lwp_put_to_user(clear_child_tid, &t, sizeof t);
841 sys_futex(clear_child_tid, FUTEX_WAKE, 1, RT_NULL, RT_NULL, 0);
842 }
843}
844
845/**
846 * @brief Terminates a lightweight process and cleans up its resources

Callers 2

lwp_exitFunction · 0.85
lwp_thread_exitFunction · 0.85

Calls 2

lwp_put_to_userFunction · 0.85
sys_futexFunction · 0.85

Tested by

no test coverage detected