Re: Performance ideas (resend) ...
- From: Dan Winship <danw gnome org>
- To: michael meeks novell com
- Cc: performance-list <performance-list gnome org>
- Subject: Re: Performance ideas (resend) ...
- Date: Thu, 05 Mar 2009 09:50:48 -0500
Michael Meeks wrote:
> Did you consider doing:
>
> if (g_main_context_is_owner (NULL)) {
> /* we are the main thread or equivalent */
> do_gconf_foo_init (NULL);
> } else {
> Waiter foo;
> g_idle_add (do_gconf_foo_init, &foo);
> g_pseudo_foo_wait (&foo);
> }
>
> As/when the thumbnailing API itself is called ? at least, this is what
> I intended g_main_context_is_owner to be good for (though perhaps it is
> still not quite what we want) ;-)
Seems like to prevent races (and the "called before main loop started"
case you mentioned) it would be better to do
if (g_main_context_acquire (NULL)) {
do_gconf_foo_init (NULL);
g_main_context_release (NULL);
} else {
...
-- Dan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]