MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mqueue_fdclose

Function mqueue_fdclose

freebsd/kern/uipc_mqueue.c:2448–2475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2446}
2447
2448static void
2449mqueue_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
2477static void
2478mq_proc_exit(void *arg __unused, struct proc *p)

Callers

nothing calls this directly

Calls 4

notifier_removeFunction · 0.85
selwakeupFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected