From 2d954fd86cdbdfbbc99429d7ab4248c2e872e151 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 9 Apr 2006 20:01:51 +0000 Subject: [PATCH] Fix wrong explanation of sleeping in an interrupt handler. Thanks to Godmar Back for reporting this bug. --- doc/tour.texi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/tour.texi b/doc/tour.texi index f4760ec..c1371cf 100644 --- a/doc/tour.texi +++ b/doc/tour.texi @@ -1093,9 +1093,9 @@ Second, an interrupt handler must not call any function that can sleep, which rules out @func{thread_yield}, @func{lock_acquire}, and many others. This is because external interrupts use space on the stack of the kernel thread that was running at the time the interrupt -occurred. If the interrupt handler tried to sleep and that thread -resumed, then the two uses of the single stack would interfere, which -cannot be allowed. +occurred. If the interrupt handler slept, it would effectively put that +thread to sleep too until the interrupt handler resumed control and +returned. Because an external interrupt runs with interrupts disabled, it effectively monopolizes the machine and delays all other activities. -- 2.30.2