aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound
diff options
context:
space:
mode:
authorMathew Kanner <matk@FreeBSD.org>2004-02-19 01:07:15 +0000
committerMathew Kanner <matk@FreeBSD.org>2004-02-19 01:07:15 +0000
commite0b6c8a1da9bb940591db60548593cbcc2926d70 (patch)
tree9dd943caa5f5edc7bdd5cd4e26ba660084606b4f /sys/dev/sound
parent77fa00fa7cec3018cef80bba9b09b94e0e42aa93 (diff)
downloadsrc-e0b6c8a1da9bb940591db60548593cbcc2926d70.tar.gz
src-e0b6c8a1da9bb940591db60548593cbcc2926d70.zip
Fix a long-standing bug where select on vchans doesn't work
(never wake up) by iterating over them when they exist. Approved by: tanimura (mentor)
Notes
Notes: svn path=/head/; revision=125982
Diffstat (limited to 'sys/dev/sound')
-rw-r--r--sys/dev/sound/pcm/channel.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c
index 610f69c94f72..baf34fdb88b0 100644
--- a/sys/dev/sound/pcm/channel.c
+++ b/sys/dev/sound/pcm/channel.c
@@ -115,11 +115,21 @@ chn_pollreset(struct pcm_channel *c)
static void
chn_wakeup(struct pcm_channel *c)
{
- struct snd_dbuf *bs = c->bufsoft;
+ struct snd_dbuf *bs = c->bufsoft;
+ struct pcmchan_children *pce;
CHN_LOCKASSERT(c);
- if (SEL_WAITING(sndbuf_getsel(bs)) && chn_polltrigger(c))
- selwakeuppri(sndbuf_getsel(bs), PRIBIO);
+ if (SLIST_EMPTY(&c->children)) {
+ if (SEL_WAITING(sndbuf_getsel(bs)) && chn_polltrigger(c))
+ selwakeup(sndbuf_getsel(bs));
+ } else {
+ SLIST_FOREACH(pce, &c->children, link) {
+ CHN_LOCK(pce->channel);
+ chn_wakeup(pce->channel);
+ CHN_UNLOCK(pce->channel);
+ }
+ }
+
wakeup(bs);
}