Fixed a bug in the threading code that would prevent new threads starting.
authorDave West <davew@uncensored.citadel.org>
Sat, 31 Oct 2009 15:29:37 +0000 (15:29 +0000)
committerDave West <davew@uncensored.citadel.org>
Sat, 31 Oct 2009 15:29:37 +0000 (15:29 +0000)
commite0288cfdf0bfeed17641a79257c0e92c32630483
tree027f52ab02df69cb233ebd6f402f2027cdf1d862
parentfdd18024d713681a62d5cc55524a060ca701331a
Fixed a bug in the threading code that would prevent new threads starting.

It was possible for threads that are running (not idle) to still be
marked as Blocked (idle).

Also Identified another problem that could prevent threads from starting.
If all existing worker threads were given a task during the same GC tick
then the system load average would go to 100% and prevent new threads.
This was due to a bad method of calculating the load average. We always
wanted the machine load average to limit the creation of new threads
so that the machine didn't become overloaded. Now we get the machine load
and use that to limit new threads. We also log a WARNING in this event.
citadel/sysdep.c
citadel/threads.c
citadel/threads.h