[gnome-db] Re: g_thread_init call.



On Tue, 2005-04-12 at 15:33 +0200, Vivien Malerba wrote:
On Apr 12, 2005 3:18 PM, Bas Driessen <bas driessen xobas com> wrote:
>  Hello Vivien,
>  
>  I noticed that you added the following line to libgda/gda-init.c
>  
>  g_thread_init (NULL);
>  
>  The application from where I link to the libgda libraries, already calls
> g_thread_init and now I get the error:
>  
>  GThread-ERROR **: GThread system may only be initialized once.
>  aborting...
>  Aborted
>  
>  I see that you put some flags around this call, so I can set the CFLAGS for
> instance to disable it, but I was wondering if it is not better to put this
> g_thread_init call somewhere else. If people are not using the thread
> features of libgda, the init function should also not be called in my
> opinion. 
>  
>  Future libgda versions that will ship with the Linux distributions, will
> probably include this g_thread_init call, so that means that I always have
> to supply a modified version of libgda, while I would like to stick with the
> "defaults". 
>  
>  Does this make sense? 
>  
>  Bas.
>  
>  

You can modify your source to:
if (!g_thread_supported ()) g_thread_init (NULL);

instead of:
g_thread_init (NULL);

I'll modify the gda_init() function to add that test myself, but you
can do that modification localy in libgda for now.

If you can't, then I'll have to modify the gda_init() function to
introduce optional inclusion of threading support, but I'd prefer not
do this since I want to introduce non blocking (asynchronous)
functions in libgda.

Vivien

Thanks Vivien. Will experiment with that and let you know if that raises any (other) issues.

Bas.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]