X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FSchedule.c;h=978adb89c8d7d9c050499a032d812122e2a770be;hb=51cae5224f2f2f5db8b3196d0f5118ba4246701a;hp=d22d48fb8f2b4e4b0d52092029d9b55cf551ad7e;hpb=ea1ad23f58b5e45731b47a1d686c0dd73766e1b7;p=ghc-hetmet.git diff --git a/rts/Schedule.c b/rts/Schedule.c index d22d48f..978adb8 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -32,6 +32,7 @@ #include "Proftimer.h" #include "ProfHeap.h" #include "GC.h" +#include "Weak.h" /* PARALLEL_HASKELL includes go here */ @@ -281,6 +282,12 @@ schedule (Capability *initialCapability, Task *task) "### NEW SCHEDULER LOOP (task: %p, cap: %p)", task, initialCapability); + if (running_finalizers) { + errorBelch("error: a C finalizer called back into Haskell.\n" + " use Foreign.Concurrent.newForeignPtr for Haskell finalizers."); + stg_exit(EXIT_FAILURE); + } + schedulePreLoop(); // -----------------------------------------------------------