From c8130a438cb63b68552b56f0a7e165e50e05f634 Mon Sep 17 00:00:00 2001 From: matk Date: Thu, 19 Feb 2004 01:07:15 +0000 Subject: 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) --- sys/dev/sound/pcm/channel.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index 610f69c..baf34fd 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); } -- cgit v1.1