On Sun, 27 Mar 2011 16:38:46 +1100, Lex wrote:
On 27 March 2011 15:59, Matthew Brush mbrush@codebrainz.ca wrote:
Hi,
Should Geany be calling g_thread_init() for the plugins? There is now 4 plugins at least affected[1][2][3][4].
Its safe to call g_thread_init multiple times, but ...
Well, g_thread_init should not be called in plugin_init since that can be called from a signal callback and thats a no-no according to the docs.
There are also a list of other issues about when it can be called, right at the beginning of the program is a really good place.
And the link options need to be different for programs using g_thread_init, and having the plugins linked differently to the main app might have other issues.
So in general, if any plugin uses glib from threads then yes Geany should use g_thread_init once for all the program, and Geany and plugins should link with "pkg-config --libs gthread-2.0"
And since you have identified four that do use threads ...
...we should do it in Geany. I fully agree. Will add the changes later today.
Regards, Enrico