Rearrange shutdownCapability code slightly
authorDuncan Coutts <duncan@well-typed.com>
Thu, 26 May 2011 14:08:43 +0000 (15:08 +0100)
committerDuncan Coutts <duncan@well-typed.com>
Thu, 26 May 2011 17:47:38 +0000 (18:47 +0100)
commit68b76e0e49d4d95e1bfe9343697e2abc99470791
treeee7ad40c51594063d45e2dddc0ac3c9655d9fc72
parentcb2d37da5792b13f5988049f67a24263b4de4ff2
Rearrange shutdownCapability code slightly

This is mostly for the beneift of having sensible places to put tracing
code later. We want a code path that has somewhere to trace (in order):
 (1) starting up all capabilities;
 (2) N * starting up an individual capability;
 (3) N * shutting down an individual capability;
 (4) shutting down all capabilities.
This has to work in both threaded and non-threaded modes.

Locations (1) and (2) are provided by initCapabilities and
initCapability respectively. Previously, there was no loccation for (4)
and while shutdownCapability should be usable for (3) it was only called
in the !THREADED_RTS case.

Now, shutdownCapability is called unconditionally (and the body is
conditonal on THREADED_RTS) and there is a new shutdownCapabilities that
calls shutdownCapability in a loop.
rts/Capability.c
rts/Capability.h
rts/Schedule.c