Fix some locking violations by creating seperate mutex classes

for play and record channels.

Approved by:	seigo (mentor)
Approved by:	scottl (re)
This commit is contained in:
Mathew Kanner 2003-12-05 02:08:13 +00:00
parent 30a62d30f4
commit bc38932a58

View File

@ -67,9 +67,12 @@ SYSCTL_INT(_hw_snd, OID_AUTO, report_soft_formats, CTLFLAG_RW,
static int chn_buildfeeder(struct pcm_channel *c); static int chn_buildfeeder(struct pcm_channel *c);
static void static void
chn_lockinit(struct pcm_channel *c) chn_lockinit(struct pcm_channel *c, int dir)
{ {
c->lock = snd_mtxcreate(c->name, "pcm channel"); if (dir == PCMDIR_PLAY)
c->lock = snd_mtxcreate(c->name, "pcm play channel");
else
c->lock = snd_mtxcreate(c->name, "pcm record channel");
} }
static void static void
@ -736,7 +739,7 @@ chn_init(struct pcm_channel *c, void *devinfo, int dir)
struct snd_dbuf *b, *bs; struct snd_dbuf *b, *bs;
int ret; int ret;
chn_lockinit(c); chn_lockinit(c, dir);
b = NULL; b = NULL;
bs = NULL; bs = NULL;