| 257 | } |
| 258 | |
| 259 | static void |
| 260 | procdesc_free(struct procdesc *pd) |
| 261 | { |
| 262 | |
| 263 | /* |
| 264 | * When the last reference is released, we assert that the descriptor |
| 265 | * has been closed, but not that the process has exited, as we will |
| 266 | * detach the descriptor before the process dies if the descript is |
| 267 | * closed, as we can't wait synchronously. |
| 268 | */ |
| 269 | if (refcount_release(&pd->pd_refcount)) { |
| 270 | KASSERT(pd->pd_proc == NULL, |
| 271 | ("procdesc_free: pd_proc != NULL")); |
| 272 | KASSERT((pd->pd_flags & PDF_CLOSED), |
| 273 | ("procdesc_free: !PDF_CLOSED")); |
| 274 | |
| 275 | knlist_destroy(&pd->pd_selinfo.si_note); |
| 276 | PROCDESC_LOCK_DESTROY(pd); |
| 277 | free(pd, M_PROCDESC); |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | /* |
| 282 | * procdesc_exit() - notify a process descriptor that its process is exiting. |
no test coverage detected