Comment 22 for bug 190291

Revision history for this message
Matthias Adler (matthias-bitshaker) wrote :

You're welcome ;) And I think we are getting close ...

If I put the 2 iterations in, Me TV still crashes with vfs-plugin installed. But then I commented out all function calls to g_thread_init() AND gdk_threads_init() so it looks like this:
if (!g_thread_supported ())
 {
// g_thread_init (NULL);
 }
 if (!g_thread_supported ())
 {
// g_thread_init (NULL);
 }
// gdk_threads_init();

after that Me TV starts and works. Yeah!

After that I looked through the GLIB Reference Manual (installed 'DevHelp'). There I stumbled upon this note:

<from manual>
g_thread_init() might only be called once. On the second call it will abort with an error. If you want to make sure that the thread system is initialized, you can do this:

if (!g_thread_supported ()) g_thread_init (NULL);

After that line, either the thread system is initialized or, if no thread system is available in GLib (i.e. either G_THREADS_ENABLED is not defined or G_THREADS_IMPL_NONE is defined), the program will abort.
</from manual>

So I wrapped the thread init code in an #ifndef macro (not sure about the G_THREADS_IMPL_NONE part).
#ifndef G_THREADS_ENABLED
 // #ifdef G_THREADS_IMPL_NONE
 if (!g_thread_supported())
 {
     g_thread_init (NULL);

    }
    gdk_threads_init();
 // #endif
 #endif

Now Me TV will work with either xine's vfs-plugin installed or not installed. I don't know if this makes any sense ... It appears g_thread_supported() is the culprit here. The information from the GLIB Reference Manual indicate that glib might be compiled with out thread-safety on Fedora.

Cheers,
Matthias