| 2446 | } |
| 2447 | |
| 2448 | static void |
| 2449 | mqueue_fdclose(struct thread *td, int fd, struct file *fp) |
| 2450 | { |
| 2451 | struct mqueue *mq; |
| 2452 | #ifdef INVARIANTS |
| 2453 | struct filedesc *fdp; |
| 2454 | |
| 2455 | fdp = td->td_proc->p_fd; |
| 2456 | FILEDESC_LOCK_ASSERT(fdp); |
| 2457 | #endif |
| 2458 | |
| 2459 | if (fp->f_ops == &mqueueops) { |
| 2460 | mq = FPTOMQ(fp); |
| 2461 | mtx_lock(&mq->mq_mutex); |
| 2462 | notifier_remove(td->td_proc, mq, fd); |
| 2463 | |
| 2464 | /* have to wakeup thread in same process */ |
| 2465 | if (mq->mq_flags & MQ_RSEL) { |
| 2466 | mq->mq_flags &= ~MQ_RSEL; |
| 2467 | selwakeup(&mq->mq_rsel); |
| 2468 | } |
| 2469 | if (mq->mq_flags & MQ_WSEL) { |
| 2470 | mq->mq_flags &= ~MQ_WSEL; |
| 2471 | selwakeup(&mq->mq_wsel); |
| 2472 | } |
| 2473 | mtx_unlock(&mq->mq_mutex); |
| 2474 | } |
| 2475 | } |
| 2476 | |
| 2477 | static void |
| 2478 | mq_proc_exit(void *arg __unused, struct proc *p) |
nothing calls this directly
no test coverage detected