* @brief Set the LWP for a given PID while holding the PID lock * * @param[in] pid The process ID to set the LWP for * @param[in] lwp The LWP to associate with the PID * * @note This function associates the specified LWP with the given PID in the * PID AVL tree. It increments the LWP's reference count and updates the * proc filesystem entry if the PID is non-zero. */
| 346 | * proc filesystem entry if the PID is non-zero. |
| 347 | */ |
| 348 | static void lwp_pid_set_lwp_locked(pid_t pid, struct rt_lwp *lwp) |
| 349 | { |
| 350 | struct lwp_avl_struct *p; |
| 351 | |
| 352 | p = lwp_avl_find(pid, lwp_pid_root); |
| 353 | if (p) |
| 354 | { |
| 355 | p->data = lwp; |
| 356 | lwp_ref_inc(lwp); |
| 357 | |
| 358 | #ifdef RT_USING_DFS_PROCFS |
| 359 | if (pid) |
| 360 | { |
| 361 | proc_pid(pid); |
| 362 | } |
| 363 | #endif |
| 364 | } |
| 365 | } |
| 366 | |
| 367 | /** |
| 368 | * @brief Close all open files for the given LWP |
no test coverage detected