glib r7935 - trunk/gio



Author: matthiasc
Date: Mon Mar  2 03:50:09 2009
New Revision: 7935
URL: http://svn.gnome.org/viewvc/glib?rev=7935&view=rev

Log:
        * giomodule.c: Use a separate lock for extension point registration
        to avoid deadlock. Discovered by Torsten Schoenfeld



Modified:
   trunk/gio/ChangeLog
   trunk/gio/giomodule.c

Modified: trunk/gio/giomodule.c
==============================================================================
--- trunk/gio/giomodule.c	(original)
+++ trunk/gio/giomodule.c	Mon Mar  2 03:50:09 2009
@@ -283,6 +283,7 @@
   return modules;
 }
 
+G_LOCK_DEFINE_STATIC (registered_extensions);
 G_LOCK_DEFINE_STATIC (loaded_dirs);
 
 extern GType _g_fen_directory_monitor_get_type (void);
@@ -302,7 +303,7 @@
   static gboolean registered_extensions = FALSE;
   GIOExtensionPoint *ep;
 
-  G_LOCK (loaded_dirs);
+  G_LOCK (registered_extensions);
   
   if (!registered_extensions)
     {
@@ -329,7 +330,7 @@
       g_io_extension_point_set_required_type (ep, G_TYPE_VFS);
     }
   
-  G_UNLOCK (loaded_dirs);
+  G_UNLOCK (registered_extensions);
  }
 
 void



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