From bc38932a58759ef52cc6fa516d9fa52259dbeef1 Mon Sep 17 00:00:00 2001 From: Mathew Kanner Date: Fri, 5 Dec 2003 02:08:13 +0000 Subject: [PATCH] Fix some locking violations by creating seperate mutex classes for play and record channels. Approved by: seigo (mentor) Approved by: scottl (re) --- sys/dev/sound/pcm/channel.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/dev/sound/pcm/channel.c b/sys/dev/sound/pcm/channel.c index fba716e8ace0..e5b0c3037fb2 100644 --- a/sys/dev/sound/pcm/channel.c +++ b/sys/dev/sound/pcm/channel.c @@ -67,9 +67,12 @@ SYSCTL_INT(_hw_snd, OID_AUTO, report_soft_formats, CTLFLAG_RW, static int chn_buildfeeder(struct pcm_channel *c); 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 @@ -736,7 +739,7 @@ chn_init(struct pcm_channel *c, void *devinfo, int dir) struct snd_dbuf *b, *bs; int ret; - chn_lockinit(c); + chn_lockinit(c, dir); b = NULL; bs = NULL;