* @brief Release a process ID and clean up associated resources * * @param[in,out] lwp The lightweight process whose PID should be released */
| 314 | * @param[in,out] lwp The lightweight process whose PID should be released |
| 315 | */ |
| 316 | void lwp_pid_put(struct rt_lwp *lwp) |
| 317 | { |
| 318 | _free_proc_dentry(lwp); |
| 319 | |
| 320 | lwp_pid_lock_take(); |
| 321 | lwp_pid_put_locked(lwp->pid); |
| 322 | if (lwp_pid_root == AVL_EMPTY) |
| 323 | { |
| 324 | rt_wqueue_wakeup_all(&_pid_emptyq, RT_NULL); |
| 325 | /* refuse any new pid allocation now */ |
| 326 | } |
| 327 | else |
| 328 | { |
| 329 | lwp_pid_lock_release(); |
| 330 | } |
| 331 | |
| 332 | /* reset pid field */ |
| 333 | lwp->pid = 0; |
| 334 | /* clear reference */ |
| 335 | lwp_ref_dec(lwp); |
| 336 | } |
| 337 | |
| 338 | /** |
| 339 | * @brief Set the LWP for a given PID while holding the PID lock |
no test coverage detected