[Xfce4-commits] r24869 - libfrap/trunk/libfrap/menu

Jannis Pohlmann jannis at xfce.org
Tue Feb 6 20:50:56 CET 2007


Author: jannis
Date: 2007-02-06 19:50:55 +0000 (Tue, 06 Feb 2007)
New Revision: 24869

Modified:
   libfrap/trunk/libfrap/menu/ChangeLog
   libfrap/trunk/libfrap/menu/frap-menu-item-cache.c
Log:
	* frap-menu-item-cache.c: Also acquire mutex lock in 
	  frap_menu_item_cache_foreach() as the item cache hash table could 
	  be modified by other threads during this call otherwise.

Modified: libfrap/trunk/libfrap/menu/ChangeLog
===================================================================
--- libfrap/trunk/libfrap/menu/ChangeLog	2007-02-06 14:00:51 UTC (rev 24868)
+++ libfrap/trunk/libfrap/menu/ChangeLog	2007-02-06 19:50:55 UTC (rev 24869)
@@ -1,5 +1,11 @@
 2007-02-06	Jannis Pohlmann <jannis at xfce.org>
 
+	* frap-menu-item-cache.c: Also acquire mutex lock in 
+	  frap_menu_item_cache_foreach() as the item cache hash table could 
+	  be modified by other threads during this call otherwise.
+
+2007-02-06	Jannis Pohlmann <jannis at xfce.org>
+
 	* frap-menu-item-cache.c: Add GMutex variable to the item cache and
 	  lock the item cache in frap_menu_item_cache_lookup() which is the
 	  only public function where the contents of the item cache may be

Modified: libfrap/trunk/libfrap/menu/frap-menu-item-cache.c
===================================================================
--- libfrap/trunk/libfrap/menu/frap-menu-item-cache.c	2007-02-06 14:00:51 UTC (rev 24868)
+++ libfrap/trunk/libfrap/menu/frap-menu-item-cache.c	2007-02-06 19:50:55 UTC (rev 24869)
@@ -341,7 +341,14 @@
                               gpointer           user_data)
 {
   g_return_if_fail (FRAP_IS_MENU_ITEM_CACHE (cache));
+
+  /* Acquire lock on the item cache */
+  g_mutex_lock (cache->priv->lock);
+
   g_hash_table_foreach (cache->priv->items, func, user_data);
+
+  /* Release item cache lock */
+  g_mutex_lock (cache->priv->lock);
 }
 
 



More information about the Xfce4-commits mailing list