[Haskell-cafe] Force -threaded from a library
John Van Enk
vanenkj at gmail.com
Fri Jan 15 10:03:56 EST 2010
Thanks Bulat,
I hadn't even considered doing it that way. :)
/jve
On Fri, Jan 15, 2010 at 3:35 AM, Bulat Ziganshin
<bulat.ziganshin at gmail.com>wrote:
> Hello John,
>
> Friday, January 15, 2010, 1:42:15 AM, you wrote:
>
> > Is it possible to prevent a library from being used unless
> > -threaded is enabled? I have a specific case where lots-of-nasty
>
> yes. it's how opposite checked in gtk2hs:
>
> when (rtsSupportsBoundThreads) $ fail $ "\n" ++
> "initGUI: Gtk+ is single threaded and so cannot safely be used from\n"
> ++
> "multiple Haskell threads when using GHC's threaded RTS. You can\n" ++
> "avoid this error by relinking your program without using the\n" ++
> "'-threaded' flag. If you have to use the threaded RTS and are\n" ++
> "absolutely sure that you only ever call Gtk+ from a single OS\n" ++
> "thread then you can use the function: unsafeInitGUIForThreadedRTS\n"
>
>
> --
> Best regards,
> Bulat mailto:Bulat.Ziganshin at gmail.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100115/7f793803/attachment.html
More information about the Haskell-Cafe
mailing list