[Goodies-dev] [Goodies-commits] r1753 - in verve-plugin/trunk: . panel-plugin

Jannis Pohlmann jannis at xfce.org
Wed Jul 12 23:34:50 CEST 2006


On Wed, 12 Jul 2006 16:04:49 +0200, Benedikt Meurer wrote:

> Jannis Pohlmann wrote:
> >>>Modified: verve-plugin/trunk/panel-plugin/verve-plugin.c
> >>>===================================================================
> >>>--- verve-plugin/trunk/panel-plugin/verve-plugin.c
> >>>2006-07-11 14:37:30 UTC (rev 1752) +++
> >>>verve-plugin/trunk/panel-plugin/verve-plugin.c	2006-07-11
> >>>15:17:52 UTC (rev 1753) @@ -79,10 +79,10 @@ void
> >>> verve_plugin_load_completion (VerveEnv* env, gpointer user_data)
> >>> {
> >>>+  gdk_threads_enter ();
> >>>+
> >>>   VervePlugin *verve = (VervePlugin*) user_data;
> >>> 
> >>>-  g_debug ("Receiving load-binaries signal\n");
> >>>-
> >>>   verve->completion = g_completion_new (NULL);
> >>> 
> >>>   /* Load command history */
> >>>@@ -91,6 +91,8 @@
> >>>   /* Load linux binaries from PATH */
> >>>   GList *binaries = verve_env_get_path_binaries (env);
> >>> 
> >>>+  g_debug ("Receiving load-binaries signal\n");
> >>>+
> >>>   /* Add command history to completion */
> >>>   if (G_LIKELY (history != NULL)) 
> >>>     g_completion_add_items (verve->completion, history);
> >>>@@ -98,6 +100,8 @@
> >>>   /* Add binaries to completion list */
> >>>   if (G_LIKELY (binaries != NULL))
> >>>     g_completion_add_items (verve->completion, binaries);
> >>>+
> >>>+  gdk_threads_leave ();
> >>> }
> >>
> >>Err, no, that doesn't change anything. Please read the GDK threads
> >>documentation.
> > 
> > In your code (thunar-vfs-job.c) I fond a GDK_THREADS_ENTER/LEAVE
> > around the signal_emit call. Would something like this work?
> > 
> > Inside of the thread:
> > 
> >     gdk_threads_enter ();
> > 
> >     /* Emit 'load-binaries' signal */
> >     g_signal_emit_by_name (env, "load-binaries");
> > 
> >     gdk_threads_leave ();
> 
> Nope. Forget about the global GDK lock, it's very difficult to use,
> esp. since the main loop in GLib runs outside the GDK lock.
> 
> Just define a static mutex, using
> 
>  G_LOCK_DEFINE_STATIC(your_lock);
> 
> and add
> 
>  G_LOCK(your_lock);
>  ...
>  G_UNLOCK(your_lock);
> 
> to protect the access to your completion.

Ah, ok. Would this require to make the completion a static variable in
verve-plugin.c, where all the panel plugin related stuff is done?

- Jannis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/goodies-dev/attachments/20060712/8849a387/attachment.pgp>


More information about the Goodies-dev mailing list