From: Duncan C. <dun...@wo...> - 2007-07-04 15:34:19
|
Tue Jul 3 13:16:48 PDT 2007 Duncan Coutts <du...@ha...> * Unbreak SOE in the single threaded case again. This is getting embarassing. hunk ./soegtk/Graphics/SOE/Gtk.hs.pp 107 -runGraphics main = do - Gtk.unsafeInitGUIForThreadedRTS - forkIO (main >> Gtk.postGUIAsync Gtk.mainQuit) - if rtsSupportsBoundThreads - then Gtk.mainGUI - else let loop = do - yield - quit <- Gtk.mainIteration - if quit then return () - else loop - in do loop - -- give any windows a chance to close - Gtk.flush +runGraphics main + | rtsSupportsBoundThreads = do + Gtk.unsafeInitGUIForThreadedRTS + forkIO (main >> Gtk.postGUIAsync Gtk.mainQuit) + Gtk.mainGUI + | otherwise = do + Gtk.initGUI + quitVar <- newIORef False + forkIO (main >> writeIORef quitVar True) + let loop = do + yield + Gtk.mainIteration + quit <- readIORef quitVar + if quit then return () + else loop + loop + -- give any windows a chance to close + Gtk.flush |