From 0712b733585f0e5c15720078d89ce2b060846a10 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 2 Mar 2009 03:50:09 +0000 Subject: [PATCH] Use a separate lock for extension point registration to avoid deadlock. * giomodule.c: Use a separate lock for extension point registration to avoid deadlock. Discovered by Torsten Schoenfeld svn path=/trunk/; revision=7935 --- gio/ChangeLog | 7 +++++++ gio/giomodule.c | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gio/ChangeLog b/gio/ChangeLog index 5cd74ea7d..a0d3bcde1 100644 --- a/gio/ChangeLog +++ b/gio/ChangeLog @@ -1,3 +1,10 @@ +2009-03-01 Matthias Clasen + + Bug 573658 – Deadlock in giomodule.c + + * giomodule.c: Use a separate lock for extension point registration + to avoid deadlock. Discovered by Torsten Schoenfeld + 2009-03-01 Matthias Clasen * gdatainputstream.c: Fix docs diff --git a/gio/giomodule.c b/gio/giomodule.c index 59f417bac..68f3b7b68 100644 --- a/gio/giomodule.c +++ b/gio/giomodule.c @@ -283,6 +283,7 @@ g_io_modules_load_all_in_directory (const char *dirname) 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 @@ _g_io_modules_ensure_extension_points_registered (void) static gboolean registered_extensions = FALSE; GIOExtensionPoint *ep; - G_LOCK (loaded_dirs); + G_LOCK (registered_extensions); if (!registered_extensions) { @@ -329,7 +330,7 @@ _g_io_modules_ensure_extension_points_registered (void) g_io_extension_point_set_required_type (ep, G_TYPE_VFS); } - G_UNLOCK (loaded_dirs); + G_UNLOCK (registered_extensions); } void -- 2.34.1