From: Axel S. <si...@co...> - 2009-04-03 16:07:03
|
Fri Mar 27 07:06:03 EDT 2009 Axel Simon <Axe...@en...> * Make explicit use of concurrent finalizers. This patch acounts for the change of semantics that finalizers undergo with the release of GHC 6.10.1. Specifcially, finalizers are now by default run during garbage collection, making it impossible to have them call back to Haskell land. This patch uses functions that specifically schedule any finilizers to be run as new threads once the mutator springs back to life. hunk ./glib/System/Glib/FFI.hs.pp 46 +#if (__GLASGOW_HASKELL__>=610) +import qualified Foreign.Concurrent +#endif hunk ./glib/System/Glib/FFI.hs.pp 53 +#if (__GLASGOW_HASKELL__>=610) +newForeignPtr :: Ptr a -> FinalizerPtr a -> IO (ForeignPtr a) +newForeignPtr p finalizer + = Foreign.Concurrent.newForeignPtr p (mkFinalizer finalizer p) + +foreign import ccall "dynamic" + mkFinalizer :: FinalizerPtr a -> Ptr a -> IO () +#else +newForeignPtr :: Ptr a -> FinalizerPtr a -> IO (ForeignPtr a) hunk ./glib/System/Glib/FFI.hs.pp 63 +#endif |