diff options
author | jhb <jhb@FreeBSD.org> | 2005-09-15 19:05:37 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2005-09-15 19:05:37 +0000 |
commit | e535e11c9f1e82c6daa8b6af94249d2f8cc719c7 (patch) | |
tree | 1a97be74d31fd11ae0c4179f921efa5d4a11fa7a /sys/kern/kern_intr.c | |
parent | 4fbd998dffe50e8632d7713e024a655da034de2f (diff) | |
download | FreeBSD-src-e535e11c9f1e82c6daa8b6af94249d2f8cc719c7.zip FreeBSD-src-e535e11c9f1e82c6daa8b6af94249d2f8cc719c7.tar.gz |
- Add a new simple facility for marking the current thread as being in a
state where sleeping on a sleep queue is not allowed. The facility
doesn't support recursion but uses a simple private per-thread flag
(TDP_NOSLEEPING). The sleepq_add() function will panic if the flag is
set and INVARIANTS is enabled.
- Use this new facility to replace the g_xup and g_xdown mutexes that were
(ab)used to achieve similar behavior.
- Disallow sleeping in interrupt threads when invoking interrupt handlers.
MFC after: 1 week
Reviewed by: phk
Diffstat (limited to 'sys/kern/kern_intr.c')
-rw-r--r-- | sys/kern/kern_intr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index 83ea2b1..d3c876d 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -521,6 +521,7 @@ ithread_loop(void *arg) * another pass. */ atomic_store_rel_int(&ithd->it_need, 0); + THREAD_NO_SLEEPING(); restart: TAILQ_FOREACH(ih, &ithd->it_handlers, ih_next) { if (ithd->it_flags & IT_SOFT && !ih->ih_need) @@ -546,6 +547,7 @@ restart: if ((ih->ih_flags & IH_MPSAFE) == 0) mtx_unlock(&Giant); } + THREAD_SLEEPING_OK(); /* * Interrupt storm handling: |