*
* ---------------------------------------------------------------------------*/
-// #include "PosixSource.h"
+#include "PosixSource.h"
#include "Rts.h"
-#include "RtsFlags.h"
+#include "HsFFI.h"
+
+#include "Storage.h"
#include "RtsUtils.h"
#include "Apply.h"
-#include "OSThreads.h"
-#include "LdvProfile.h"
#include "Updates.h"
#include "Stats.h"
#include "Schedule.h"
#include "Sanity.h"
#include "BlockAlloc.h"
-#include "MBlock.h"
#include "ProfHeap.h"
-#include "SchedAPI.h"
#include "Weak.h"
#include "Prelude.h"
-#include "ParTicky.h" // ToDo: move into Rts.h
#include "RtsSignals.h"
#include "STM.h"
-#include "HsFFI.h"
-#include "Linker.h"
#if defined(RTS_GTK_FRONTPANEL)
#include "FrontPanel.h"
#endif
#include "Trace.h"
#include "RetainerProfile.h"
+#include "LdvProfile.h"
#include "RaiseAsync.h"
#include "Papi.h"
+#include "Stable.h"
#include "GC.h"
#include "GCThread.h"
}
}
+void
+freeGcThreads (void)
+{
+ if (gc_threads != NULL) {
+#if defined(THREADED_RTS)
+ nat i;
+ for (i = 0; i < RtsFlags.ParFlags.nNodes; i++) {
+ stgFree (gc_threads[i]);
+ }
+ stgFree (gc_threads);
+#else
+ stgFree (gc_threads);
+#endif
+ gc_threads = NULL;
+ }
+}
+
/* ----------------------------------------------------------------------------
Start GC threads
------------------------------------------------------------------------- */
#endif
+#if defined(THREADED_RTS)
+
void
waitForGcThreads (Capability *cap USED_IF_THREADS)
{
-#if defined(THREADED_RTS)
nat n_threads = RtsFlags.ParFlags.nNodes;
nat me = cap->no;
nat i, j;
if (!retry) break;
}
}
-#endif
}
+#endif // THREADED_RTS
+
static void
start_gc_threads (void)
{
#endif
}
+#if defined(THREADED_RTS)
void
releaseGCThreads (Capability *cap USED_IF_THREADS)
{
-#if defined(THREADED_RTS)
nat n_threads = RtsFlags.ParFlags.nNodes;
nat me = cap->no;
nat i;
ACQUIRE_SPIN_LOCK(&gc_threads[i]->gc_spin);
RELEASE_SPIN_LOCK(&gc_threads[i]->mut_spin);
}
-#endif
}
+#endif
/* ----------------------------------------------------------------------------
Initialise a generation that is to be collected