
On Mon, Jul 4, 2011 at 2:02 AM, Jason Dagit
My second question is, if there is no current workaround then how can we remedy this situation? It seems like there could be an api function like: runOnOriginalThread :: IO a -> IO a
Isn't there something on Cocoa that would allow you to implement this function? For example, to implement postGUISync [1] on Gtk2Hs, Glib's g_idle_add() [2] is used [3]. To implement Gtk.Application.Invoke [4] on Gtk#, Glib's g_timeout_add with a timeout of 0 seconds is used [6]. In other words, some way of running an arbitrary function inside Cocoa's event loop. Cheers! =) [1] http://hackage.haskell.org/packages/archive/gtk/0.12.0/doc/html/Graphics-UI-... [2] http://developer.gnome.org/glib/2.28/glib-The-Main-Event-Loop.html#g-idle-ad... [3] http://hackage.haskell.org/packages/archive/gtk/0.12.0/doc/html/src/Graphics... [4] (link seems broken) http://www.go-mono.com/docs/monodoc.ashx?link=M%3aGtk.Application.Invoke(Sys...) [5] http://developer.gnome.org/glib/2.28/glib-The-Main-Event-Loop.html#g-timeout... [6] https://github.com/mono/gtk-sharp/blob/master/gtk/Application.cs#L200 -- Felipe.