X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FRtsAPI.c;h=54d1e7567282544e54a67b29cb5b84e92505cf5e;hb=26caccd3a492556ecce7c36ce69cecc2ae7c5a75;hp=3eecab14d4eb65a3a0d35ea34e3d133dd9388aba;hpb=a2a67cd520b9841114d69a87a423dabcb3b4368e;p=ghc-hetmet.git diff --git a/rts/RtsAPI.c b/rts/RtsAPI.c index 3eecab1..54d1e75 100644 --- a/rts/RtsAPI.c +++ b/rts/RtsAPI.c @@ -16,6 +16,7 @@ #include "Schedule.h" #include "Capability.h" #include "Stable.h" +#include "Weak.h" /* ---------------------------------------------------------------------------- Building Haskell objects from C datatypes. @@ -537,6 +538,14 @@ rts_lock (void) Capability *cap; Task *task; + if (running_finalizers) { + errorBelch("error: a C finalizer called back into Haskell.\n" + " This was previously allowed, but is disallowed in GHC 6.10.2 and later.\n" + " To create finalizers that may call back into Haskll, use\n" + " Foreign.Concurrent.newForeignPtr instead of Foreign.newForeignPtr."); + stg_exit(EXIT_FAILURE); + } + task = newBoundTask(); cap = NULL;