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)
This commit is contained in:
Mathew Kanner 2004-02-19 01:07:15 +00:00
parent 77fa00fa7c
commit e0b6c8a1da
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125982

View File

@ -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);
}