DragonFly commits List (threaded) for 2005-12
cvs commit: src/sys/kern lwkt_thread.c
dillon 2005/12/10 10:50:36 PST
DragonFly src repository
Fix another interesting bug. td_threadq is shared by the LWKT scheduler,
tsleep, and port-blocking code. Because of this separate flags exist to
indicate which queue the thread currently resides on and careful sanity
checks were added to prevent corruption.
The thread scheduler will not enqueue a thread that is sitting on one of
these other queues. This commit fixes a bug where the preemption code
would still preemptively switch into the thread even when the enqueue fails,
causing an assertion to be hit in tsleep().
This just goes to show that asserting on supposedly impossible conditions is
a good idea :-).
Reported-by: Stefan Krueger <skrueger@xxxxxxxxxxxxxxxx>
Revision Changes Path
1.90 +12 -6 src/sys/kern/lwkt_thread.c