* @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
| 830 | * - Clears the thread's clear_child_tid pointer |
| 831 | */ |
| 832 | rt_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 |
no test coverage detected