Re: Multithreading problems -- with short example



Hi,

Brad House <brad mainstreetsoftworks com> writes:


> int main(int argc, char *argv[])
> {
>   pthread_t thread;
> 
>   /* init gtk */
>   gtk_init(&argc, &argv);

put "g_thread_init (NULL);" before gtk_init() and everything 
should work.

Folks, before you write endless mails here, why don't you just 
take a quick look into the source? A quick grep for 
gdk_threads_enter|leave shows that it will only do something 
if gdk_threads_mutex != NULL. gdk_threads_mutex is initialized
in gdk.c only if g_thread_supported() which is TRUE only after
g_thread_init() has been called.


Salut, Sven




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