PERFORCE change 100571 for review

Ryan Beasley ryanb at FreeBSD.org
Tue Jul 4 19:57:36 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=100571

Change 100571 by ryanb at ryanb_yuki on 2006/07/04 19:57:31

	Add a few mtx_assert()s for extra sanity checking goodness.

Affected files ...

.. //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/pcm/dsp.c#10 edit
.. //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/pcm/sound.c#8 edit

Differences ...

==== //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/pcm/dsp.c#10 (text+ko) ====

@@ -1356,11 +1356,14 @@
 		if (d == NULL)
 			continue;
 
+		/* See the note in function docblock */
+		mtx_assert(d->lock, MA_NOTOWNED);
 		pcm_inprog(d, 1);
 		pcm_lock(d);
 
 		SLIST_FOREACH(sce, &d->channels, link) {
 			ch = sce->channel;
+			mtx_assert(ch->lock, MA_NOTOWNED);
 			CHN_LOCK(ch);
 			if (ai->dev == -1) {
 				if ((ch == i_dev->si_drv1) ||

==== //depot/projects/soc2006/rbeasley_sound/sys/dev/sound/pcm/sound.c#8 (text+ko) ====

@@ -1171,6 +1171,8 @@
 			if (!d)
 				continue;
 
+			/* See note in function's docblock */
+			mtx_assert(d->lock, MA_NOTOWNED);
 			/* Increment device's "operations in progress" */
 			pcm_inprog(d, 1);
 			pcm_lock(d);
@@ -1180,6 +1182,7 @@
 
 			SLIST_FOREACH(sce, &d->channels, link) {
 				c = sce->channel;
+				mtx_assert(c->lock, MA_NOTOWNED);
 				CHN_LOCK(c);
 				if (c->flags & CHN_F_BUSY)
 					si->openedaudio[j / intnbits] |=


More information about the p4-projects mailing list