On Tue, 2006-04-25 at 18:13 +0100, Axel Simon wrote:
> On Tue, 2006-04-25 at 10:08 -0700, Duncan Coutts wrote:
> > Tue Apr 25 10:03:38 PDT 2006 Duncan Coutts <duncan@...>
> > * #ifdef stuff to support the C FFI API of both ghc-6.4 and 6.5+
> > hunk ./glib/System/Glib/hsgclosure.c 43
> > -#define rts_unlock()
> > +#define rts_unlock(x)
> > +#endif
> > +
> > +#if __GLASGOW_HASKELL__>604
> > +#define GHC_RTS_USES_CAPABILITY
> > +#define CAP cap,
> > +#else
> > +#define CAP
> Is there a one-line explanation for the faint-hearted? Or is this just
The C API of ghc's RTS has changed in ghc-6.5. Several functions now
take a Capability. Basically this gives you access to a context in which
to run Haskell code. Since ghc can now support parallel execution of
Haskell code there is no longer just one global Capability and hence why
the RTS functions need to be given it as a parameter.
rts_lock() now returns the capability and rts_unlock() releases it.
All my ifdef magic allows the code to work with both. It might be
cleaner to just have two different versions of the file.