   idleAdd (action >> return False) priorityDefault
   return ()
 
+-- | Acquired the global Gtk lock.
+--
+-- * During normal operation, this lock is held by the thread from which all
+--   interaction with Gtk is performed. When calling 'mainGUI', the thread will
+--   release this global lock before it waits for user interaction. During this
+--   time it is, in principle, possible to use a different OS thread (any other
+--   Haskell thread that is bound to the Gtk OS thread will be blocked anyway)
+--   to interact with Gtk by explicitly acquiring the lock, calling Gtk functions
+--   and releasing the lock. However, the Gtk functions that are called from this
+--   different thread may not trigger any calls to the OS since this will
+--   lead to a crash on Windows (the Win32 API can only be used from a single
+--   thread). Since it is very hard to tell which function only interacts on
+--   Gtk data structures and which function call actual OS functions, it
+--   is best not to use this feature at all. A better way to perform updates
+--   in the background is to spawn a Haskell thread and to perform the update
+--   to Gtk widgets using 'postGUIAsync' or 'postGUISync'. These will execute
+--   their arguments from the main loop, that is, from the OS thread of Gtk,
+--   thereby ensuring that any Gtk and OS function can be called.
+--
+{#fun unsafe gdk_threads_enter as threadsEnter {} -> `()' #}
+
+-- | Release the global Gtk lock.
+--
+-- * The use of this function is not recommended. See 'threadsEnter'.
+--
+{#fun unsafe gdk_threads_leave as threadsLeave {} -> `()' #}
+
 -- | Inquire the number of events pending on the event queue
 --
 eventsPending :: IO Int

--  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,
