diff options
author | bmilekic <bmilekic@FreeBSD.org> | 2001-01-19 01:59:14 +0000 |
---|---|---|
committer | bmilekic <bmilekic@FreeBSD.org> | 2001-01-19 01:59:14 +0000 |
commit | 37decc93f5a2dfb49438d1e77245218780583ef6 (patch) | |
tree | 2e4b859fb1993ec2fe69e3e946d14a9fdc9cf441 /sys/amd64 | |
parent | 5977e97236d57a51dc2ddf0634bb4a69d30dc36f (diff) | |
download | FreeBSD-src-37decc93f5a2dfb49438d1e77245218780583ef6.zip FreeBSD-src-37decc93f5a2dfb49438d1e77245218780583ef6.tar.gz |
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
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/machdep.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index a6d27ea..225ec00 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -422,7 +422,7 @@ again: TAILQ_INIT(&callwheel[i]); } - mtx_init(&callout_lock, "callout", MTX_SPIN); + mtx_init(&callout_lock, "callout", MTX_SPIN | MTX_RECURSE); #if defined(USERCONFIG) userconfig(); @@ -441,7 +441,7 @@ again: SLIST_INIT(&cpuhead); SLIST_INSERT_HEAD(&cpuhead, GLOBALDATA, gd_allcpu); - mtx_init(&sched_lock, "sched lock", MTX_SPIN | MTX_COLD); + mtx_init(&sched_lock, "sched lock", MTX_SPIN | MTX_COLD | MTX_RECURSE); #ifdef SMP /* @@ -1939,7 +1939,7 @@ init386(first) /* * We need this mutex before the console probe. */ - mtx_init(&clock_lock, "clk", MTX_SPIN | MTX_COLD); + mtx_init(&clock_lock, "clk", MTX_SPIN | MTX_COLD | MTX_RECURSE); /* * Initialize the console before we print anything out. @@ -1954,7 +1954,7 @@ init386(first) /* * Giant is used early for at least debugger traps and unexpected traps. */ - mtx_init(&Giant, "Giant", MTX_DEF | MTX_COLD); + mtx_init(&Giant, "Giant", MTX_DEF | MTX_COLD | MTX_RECURSE); #ifdef DDB kdb_init(); |