X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FRtsAPI.c;h=54d1e7567282544e54a67b29cb5b84e92505cf5e;hb=ce9a12321f228ab68934e3031c32ab7f9a2173fc;hp=df4315fdb82183bcc3d9979f5a02389363e96671;hpb=5d379cbe65e406d5c3a848fe7fcd090cafbfeb78;p=ghc-hetmet.git diff --git a/rts/RtsAPI.c b/rts/RtsAPI.c index df4315f..54d1e75 100644 --- a/rts/RtsAPI.c +++ b/rts/RtsAPI.c @@ -8,17 +8,15 @@ #include "PosixSource.h" #include "Rts.h" -#include "OSThreads.h" #include "RtsAPI.h" -#include "SchedAPI.h" -#include "RtsFlags.h" +#include "HsFFI.h" + #include "RtsUtils.h" #include "Prelude.h" #include "Schedule.h" #include "Capability.h" #include "Stable.h" - -#include +#include "Weak.h" /* ---------------------------------------------------------------------------- Building Haskell objects from C datatypes. @@ -540,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;