diff options
author | julian <julian@FreeBSD.org> | 2004-12-16 23:19:57 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2004-12-16 23:19:57 +0000 |
commit | 3b2878da37add43296ace63d9752644b2aad33d3 (patch) | |
tree | 5bf0bb14e589dd53f38f59e460e788ecd06ae786 /sys | |
parent | dad7ad8289b6196e4cae67e458eccf1e7cd6b297 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | sys/dev/bktr/msp34xx.c | 6 |
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) { |