Re: gdk_threads_enter/leave() in threaded and non threaded situation (SOLVED)
- From: Stefan Kost <ensonic hora-obscura de>
- To: Stefan Kost <ensonic hora-obscura de>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: gdk_threads_enter/leave() in threaded and non threaded situation (SOLVED)
- Date: Sat, 12 Feb 2005 09:32:01 +0100
just a closing follow up. I found a solution in rythmbox sources :
static GThread *main_thread = NULL;
void rb_thread_helpers_init (void) {
main_thread = g_thread_self ();
}
gboolean rb_thread_helpers_in_main_thread (void) {
return (main_thread == g_thread_self ());
}
void rb_thread_helpers_lock_gdk (void) {
if (!rb_thread_helpers_in_main_thread ()) gdk_threads_enter ();
}
void rb_thread_helpers_unlock_gdk (void) {
if (!rb_thread_helpers_in_main_thread ()) gdk_threads_leave ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]