* @brief Release a PID back to the free list while holding the PID lock * * @param[in] pid The process ID to release (must not be 0) * * @note This function removes the specified PID from the active PID tree and * adds it to the free list. The operation is performed atomically while * holding the PID management lock. */
| 272 | * holding the PID management lock. |
| 273 | */ |
| 274 | static void lwp_pid_put_locked(pid_t pid) |
| 275 | { |
| 276 | struct lwp_avl_struct *p; |
| 277 | |
| 278 | if (pid == 0) |
| 279 | { |
| 280 | return; |
| 281 | } |
| 282 | |
| 283 | p = lwp_avl_find(pid, lwp_pid_root); |
| 284 | if (p) |
| 285 | { |
| 286 | p->data = RT_NULL; |
| 287 | lwp_avl_remove(p, &lwp_pid_root); |
| 288 | p->avl_right = lwp_pid_free_head; |
| 289 | lwp_pid_free_head = p; |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | #ifdef RT_USING_DFS_PROCFS |
| 294 | /** |
no test coverage detected