GNOME Bugzilla – Bug 372013
Use pan's error log, rather than g_message(), in connection worker threads
Last modified: 2007-01-25 08:05:23 UTC
http://gnunet.org/doxygen/html/io_8c-source.html http://www.developerweb.net/forum/showthread.php?p=13486
There are two things that can stall pan when it creates a connection. The actual connect call and the dns lookup. While the connect can be handled in a non-blocking manner, the dns lookup can't. This is the reason that threads are being used for the connection attempt. If the real problem is one of error reporting, that's an easy fix. Just store the error in the ThreadInfo struct and output it in the idle function.
Created attachment 78898 [details] [review] A thread safe logger Instead of implementing the connection as a non blocking operation, I modifyed the logger in order to be able to call it from threads.
I don't think that the patch in Comment #2 is safe. The Log still notifies the GUI of changes, and gtk+ isn't threadsafe, so those log events may come in at the wrong time.
Created attachment 80216 [details] [review] Use K Haley's approach described in comment #1
Created attachment 81019 [details] [review] Better thread safe logger I effectively encountered lot of problems with my previous patch. I reworked it. I added gdk_threads_enter()/gdk_threads_leave() calls to protect GDK calls inside the logging process.
Comment on attachment 81019 [details] [review] Better thread safe logger Not so better. Works sometimes.