diff options
author | imp <imp@FreeBSD.org> | 2005-10-08 06:51:47 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2005-10-08 06:51:47 +0000 |
commit | 1fddd6361f55f1efc4a923978b92de6866daa6ef (patch) | |
tree | b01bf8bf4382d0f1ce5bbb0c691cd82e52964348 /sys/dev/pccbb | |
parent | a724afd1df3277a764f88247e4d2c912673059e8 (diff) | |
download | FreeBSD-src-1fddd6361f55f1efc4a923978b92de6866daa6ef.zip FreeBSD-src-1fddd6361f55f1efc4a923978b92de6866daa6ef.tar.gz |
MFP4: Note why we do the dance we do for waiting for the thread to die.
Diffstat (limited to 'sys/dev/pccbb')
-rw-r--r-- | sys/dev/pccbb/pccbb.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index 2d88eab..6b39e7d 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -306,6 +306,14 @@ cbb_detach(device_t brdev) * XXX buggy client drivers? */ bus_teardown_intr(brdev, sc->irq_res, sc->intrhand); + /* + * Wait for the thread to die. kthread_exit will do a wakeup + * on the event thread's struct thread * so that we know it is + * save to proceed. IF the thread is running, set the please + * die flag and wait for it to comply. Since the wakeup on + * the event thread happens only in kthread_exit, we don't + * need to loop here. + */ sc->flags |= CBB_KTHREAD_DONE; if (sc->flags & CBB_KTHREAD_RUNNING) { cv_broadcast(&sc->cv); |