summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/pcm/vchan.c
diff options
context:
space:
mode:
authorcg <cg@FreeBSD.org>2001-06-14 13:31:30 +0000
committercg <cg@FreeBSD.org>2001-06-14 13:31:30 +0000
commit2ec7f0d19f7d1d4e02ec98b605a460f015c9f6b5 (patch)
tree9f09ca16ead4ae8551bd8e8a2b22dfd4bc4becc8 /sys/dev/sound/pcm/vchan.c
parent089e07ab6ac0a4433ae32cbdb9e4c1b4936995a6 (diff)
downloadFreeBSD-src-2ec7f0d19f7d1d4e02ec98b605a460f015c9f6b5.zip
FreeBSD-src-2ec7f0d19f7d1d4e02ec98b605a460f015c9f6b5.tar.gz
various locking fixes, rework open logic and channel registration
PR: kern/28084
Diffstat (limited to 'sys/dev/sound/pcm/vchan.c')
-rw-r--r--sys/dev/sound/pcm/vchan.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c
index dc5358d..3866ece 100644
--- a/sys/dev/sound/pcm/vchan.c
+++ b/sys/dev/sound/pcm/vchan.c
@@ -332,7 +332,7 @@ sysctl_hw_snd_vchans(SYSCTL_HANDLER_ARGS)
struct snddev_info *d;
struct snddev_channel *sce;
struct pcm_channel *c;
- int err, newcnt, cnt;
+ int err, oldcnt, newcnt, cnt;
d = oidp->oid_arg1;
@@ -343,6 +343,7 @@ sysctl_hw_snd_vchans(SYSCTL_HANDLER_ARGS)
if ((c->direction == PCMDIR_PLAY) && (c->flags & CHN_F_VIRTUAL))
cnt++;
}
+ oldcnt = cnt;
newcnt = cnt;
err = sysctl_handle_int(oidp, &newcnt, sizeof(newcnt), req);
@@ -379,6 +380,8 @@ addok:
if (err == 0)
cnt++;
}
+ if (SLIST_EMPTY(&c->children))
+ c->flags &= ~CHN_F_BUSY;
} else if (newcnt < cnt) {
while (err == 0 && newcnt < cnt) {
SLIST_FOREACH(sce, &d->channels, link) {
OpenPOWER on IntegriCloud