Re: Call to GDK_THREADS_ENTER in gtk_main



-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Padraig O'Briain wrote:
> The function gtk_main contains the code.
> 
>  if (g_main_loop_is_running (main_loops->data))
>     {
>       GDK_THREADS_LEAVE ();
>       g_main_loop_run (loop);
>       GDK_THREADS_ENTER ();
>       gdk_flush ();
>     }
> 
> When GDK_THREADS_LEAVE is called do we expect the mutex to be locked?
> 
> If yes, what code locks it?
> 
> If no, should GDK_THREADS_ENTER be called previously  so that the 
> mutex_unlock call does not fail?

If the thread system hasn't been initialised (i.e., you haven't called
g_thread_init() and gdk_threads_init() before gtk_init()), then
GDK_THREADS_LEAVE() and GDK_THREADS_ENTER() won't do anything.  If you
have, then you're expected to have called gdk_threads_enter() before
calling gtk_main().  Read the gtk/gdk threading docs for more info.

(Might this question be better suited to gtk-app-devel-list?)

	-brian

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.1 (GNU/Linux)

iD8DBQFFtIx06XyW6VEeAnsRA16zAKCu7IlKma6D0y1gZ3hdb/A6nZnF0ACgvjjs
5kKeFnVmwHqulYAql78sHzI=
=l3m9
-----END PGP SIGNATURE-----



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