From 37decc93f5a2dfb49438d1e77245218780583ef6 Mon Sep 17 00:00:00 2001 From: bmilekic Date: Fri, 19 Jan 2001 01:59:14 +0000 Subject: Implement MTX_RECURSE flag for mtx_init(). All calls to mtx_init() for mutexes that recurse must now include the MTX_RECURSE bit in the flag argument variable. This change is in preparation for an upcoming (further) mutex API cleanup. The witness code will call panic() if a lock is found to recurse but the MTX_RECURSE bit was not set during the lock's initialization. The old MTX_RECURSE "state" bit (in mtx_lock) has been renamed to MTX_RECURSED, which is more appropriate given its meaning. The following locks have been made "recursive," thus far: eventhandler, Giant, callout, sched_lock, possibly some others declared in the architecture-specific code, all of the network card driver locks in pci/, as well as some other locks in dev/ stuff that I've found to be recursive. Reviewed by: jhb --- sys/pci/if_wb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/pci/if_wb.c') diff --git a/sys/pci/if_wb.c b/sys/pci/if_wb.c index 19893cf..fecc20d 100644 --- a/sys/pci/if_wb.c +++ b/sys/pci/if_wb.c @@ -817,7 +817,7 @@ static int wb_attach(dev) sc = device_get_softc(dev); unit = device_get_unit(dev); - mtx_init(&sc->wb_mtx, device_get_nameunit(dev), MTX_DEF); + mtx_init(&sc->wb_mtx, device_get_nameunit(dev), MTX_DEF | MTX_RECURSE); WB_LOCK(sc); /* -- cgit v1.1