summaryrefslogtreecommitdiffstats
path: root/sys/dev/bktr
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2004-12-16 23:19:57 +0000
committerjulian <julian@FreeBSD.org>2004-12-16 23:19:57 +0000
commit3b2878da37add43296ace63d9752644b2aad33d3 (patch)
tree5bf0bb14e589dd53f38f59e460e788ecd06ae786 /sys/dev/bktr
parentdad7ad8289b6196e4cae67e458eccf1e7cd6b297 (diff)
downloadFreeBSD-src-3b2878da37add43296ace63d9752644b2aad33d3.zip
FreeBSD-src-3b2878da37add43296ace63d9752644b2aad33d3.tar.gz
Add some locking for -currnet/5.x
PR: 74305 Submitted by: Anish Mistry <amistry at am-productions dot biz> MFC after: 1 week
Diffstat (limited to 'sys/dev/bktr')
-rw-r--r--sys/dev/bktr/msp34xx.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/bktr/msp34xx.c b/sys/dev/bktr/msp34xx.c
index d328613..940205a 100644
--- a/sys/dev/bktr/msp34xx.c
+++ b/sys/dev/bktr/msp34xx.c
@@ -706,6 +706,7 @@ static void msp3400c_thread(void *data)
dprintk("msp3400: thread started\n");
+ mtx_lock(&Giant);
for (;;) {
if (msp->rmmod)
goto done;
@@ -896,6 +897,7 @@ done:
msp->kthread = NULL;
wakeup(&msp->kthread);
+ mtx_unlock(&Giant);
kthread_exit(0);
}
@@ -940,6 +942,7 @@ static void msp3410d_thread(void *data)
dprintk("msp3410: thread started\n");
+ mtx_lock(&Giant);
for (;;) {
if (msp->rmmod)
goto done;
@@ -1121,6 +1124,7 @@ done:
msp->kthread = NULL;
wakeup(&msp->kthread);
+ mtx_unlock(&Giant);
kthread_exit(0);
}
@@ -1217,12 +1221,14 @@ int msp_detach(bktr_ptr_t client)
if (msp->kthread)
{
/* XXX mutex lock required */
+ mtx_lock(&Giant);
msp->rmmod = 1;
msp->watch_stereo = 0;
wakeup(msp->kthread);
while (msp->kthread)
tsleep(&msp->kthread, PRIBIO, "wait for kthread", hz/10);
+ mtx_unlock(&Giant);
}
if (client->msp3400c_info != NULL) {
OpenPOWER on IntegriCloud