diff options
author | Warner Losh <imp@FreeBSD.org> | 2005-10-08 06:51:47 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2005-10-08 06:51:47 +0000 |
commit | ed448ee4de5f8c7cb4d8ffff46d486128774332d (patch) | |
tree | b01bf8bf4382d0f1ce5bbb0c691cd82e52964348 /sys/dev/pccbb | |
parent | a3699bcaa69d9d90c8a8ff360450dc9f04353cff (diff) | |
download | src-ed448ee4de5f8c7cb4d8ffff46d486128774332d.tar.gz src-ed448ee4de5f8c7cb4d8ffff46d486128774332d.zip |
MFP4: Note why we do the dance we do for waiting for the thread to die.
Notes
Notes:
svn path=/head/; revision=151078
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 2d88eab81a1b..6b39e7da46a6 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); |