FreeBSD/sys/kern/kern_conf.c
/*
 * devmtx shall be locked on entry. devmtx will be unlocked after
 * function return.
 */
devmtx shall be locked on entry. devmtx will be unlocked after
function return.
devmtx shall be locked on entry . devmtx will be unlocked after function return .
static int
destroy_dev_sched_cbl(struct cdev *dev, void (*cb)(void *), void *arg)
{
	struct cdev_priv *cp;
	mtx_assert(&devmtx, MA_OWNED);
	cp = cdev2priv(dev);
	if (cp->cdp_flags & CDP_SCHED_DTR) {
		dev_unlock();
		return (0);
	}
	dev_refl(dev);
	cp->cdp_flags |= CDP_SCHED_DTR;
	cp->cdp_dtr_cb = cb;
	cp->cdp_dtr_cb_arg = arg;
	TAILQ_INSERT_TAIL(&dev_ddtr, cp, cdp_dtr_list);
	dev_unlock();
	taskqueue_enqueue(taskqueue_swi_giant, &dev_dtr_task);
	return (1);
}
static int destroy_dev_sched_cbl ( struct cdev * dev , void ( * cb ) ( void * ) , void * arg ) { struct cdev_priv * cp ; mtx_assert ( & devmtx , MA_OWNED ) ; cp = cdev2priv ( dev ) ; if ( cp -> cdp_flags & CDP_SCHED_DTR ) { dev_unlock ( ) ; return ( 0 ) ; } dev_refl ( dev ) ; cp -> cdp_flags |= CDP_SCHED_DTR ; cp -> cdp_dtr_cb = cb ; cp -> cdp_dtr_cb_arg = arg ; TAILQ_INSERT_TAIL ( & dev_ddtr , cp , cdp_dtr_list ) ; dev_unlock ( ) ; taskqueue_enqueue ( taskqueue_swi_giant , & dev_dtr_task ) ; return ( 1 ) ; }
devmtx shall be locked on entry.
devmtx shall be locked on entry .