 --
 -- * Throws: @error \"Cannot initialize GUI.\"@
 --
+--
+-- * If you want to use Gtk2Hs and in a multi-threaded application then it is your obligation
+--   to ensure that all calls to Gtk+ happen on a single OS thread.
+--   If you want to make calls to Gtk2Hs functions from a Haskell thread other
+--   than the one that calls this functions and 'mainGUI' then you will have to
+--   \'post\' your GUI actions to the main GUI thread. You can do this using
+--   'postGUISync' or 'postGUIAsync'. See also 'threadsEnter'.
+--
 initGUI :: IO [String]
 initGUI = do
-  name <- getProgName
-  when (rtsSupportsBoundThreads && name /= "<interactive>") $ 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"
-
-  unsafeInitGUIForThreadedRTS
-
-{-# NOINLINE unsafeInitGUIForThreadedRTS #-}
--- | Same as initGUI except that it prints no warning when used with GHC's
--- threaded RTS.
---
--- If you want to use Gtk2Hs and the threaded RTS then it is your obligation
--- to ensure that all calls to Gtk+ happen on a single OS thread.
--- If you want to make calls to Gtk2Hs functions from a Haskell thread other
--- than the one that calls this functions and 'mainGUI' then you will have to
--- \'post\' your GUI actions to the main GUI thread. You can do this using
--- 'postGUISync' or 'postGUIAsync'.
---
-unsafeInitGUIForThreadedRTS :: IO [String]
-unsafeInitGUIForThreadedRTS = do
   when rtsSupportsBoundThreads initialiseGThreads
+  threadsEnter
   prog <- getProgName
   args <- getArgs
   let allArgs = (prog:args)

--  return str
-}

-- We compile this module using -#includ"gtk/wingtk.h" to bypass the win32 abi
-- check however we do not compile users programs with this header so if
-- initGUI was ever inlined in a users program, then that program would not

  unsafeInitGUIForThreadedRTS,
  postGUISync,
  postGUIAsync,
  threadsEnter,
  threadsLeave,
  
  -- * Main event loop
  mainGUI,
  mainQuit,
