[project @ 2002-02-14 07:52:05 by sof]
authorsof <unknown>
Thu, 14 Feb 2002 07:52:05 +0000 (07:52 +0000)
committersof <unknown>
Thu, 14 Feb 2002 07:52:05 +0000 (07:52 +0000)
commitefa41d9d5eada7aa3230a2bd03b97a8b7025ef2e
tree997bd6faf1c86d8386368712a60a1a1ced98495d
parent05abfa38be95d3042b09738408ba95beac50418d
[project @ 2002-02-14 07:52:05 by sof]
Restructured / tidied a bit:

* Capability.grabReturnCapability() is now called by resumeThread().
  It takes care of waiting on the (Capability.c-local) condition
  variable, 'returning_worker_cond' (moved here from Schedule.c)

* If a worker notices upon entry to the Scheduler that there are
  worker threads waiting to deposit results of external calls,
  it gives up its capability by calling Capability.yieldCapability().

* Added Scheduler.waitForWork(), which takes care of blocking
  on 'thread_ready_cond' (+ 'rts_n_waiting_tasks' book-keeping).

Note: changes haven't been fully tested, due to HEAD instability.
ghc/rts/Capability.c
ghc/rts/Capability.h
ghc/rts/Schedule.c