X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=doc%2Fthreads.texi;h=c1519e85a0df8774a0586c1c1a5d8da70ca0df66;hb=b47827fe69fdc8e486c91e094765cd94f3070086;hp=c1381d01dabd7107dc878e2763fe29668802cc2e;hpb=53a7f5d0952a4595f252247f5ee3d017468eb57e;p=pintos-anon diff --git a/doc/threads.texi b/doc/threads.texi index c1381d0..c1519e8 100644 --- a/doc/threads.texi +++ b/doc/threads.texi @@ -633,7 +633,7 @@ does not actually mean that @func{pass} called @func{debug_panic}. In fact, @func{fail} called @func{debug_panic} (via the @func{PANIC} macro). GCC knows that @func{debug_panic} does not return, because it is declared @code{NO_RETURN} (@pxref{Function and Parameter -Attributes}), so it doesn't include any code in @func{pass} to take +Attributes}), so it doesn't include any code in @func{fail} to take control when @func{debug_panic} returns. This means that the return address on the stack looks like it is at the beginning of the function that happens to follow @func{fail} in memory, which in this case happens @@ -740,11 +740,9 @@ to thread @var{B} (with priority 3), then @var{B}'s new priority is 5, not 8. @item Can a thread's priority change while it is on the ready queue? -Yes. Consider this case: low-priority thread @var{L} holds a -lock that high-priority thread @var{H} wants, so @var{H} donates its -priority to @var{L}. @var{L} releases the lock and -thus loses the CPU and is moved to the ready queue. Now @var{L}'s -old priority is restored while it is in the ready queue. +Yes. Consider a ready, low-priority thread @var{L} that holds a lock. +High-priority thread @var{H} attempts to acquire the lock and blocks, +thereby donating its priority to ready thread @var{L}. @item Can a thread's priority change while it is blocked?