Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(748)

Unified Diff: net/proxy/proxy_config_service_linux.cc

Issue 99126: Mutual exclusion between gconf and the glib main loop. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/chrome_dll_main.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_config_service_linux.cc
===================================================================
--- net/proxy/proxy_config_service_linux.cc (revision 14449)
+++ net/proxy/proxy_config_service_linux.cc (working copy)
@@ -8,7 +8,9 @@
#include <gdk/gdk.h>
#include <stdlib.h>
+#include "base/lock.h"
#include "base/logging.h"
+#include "base/message_pump_glib.h"
#include "base/string_tokenizer.h"
#include "base/string_util.h"
#include "googleurl/src/url_canon.h"
@@ -258,10 +260,17 @@
}
virtual void Enter() {
- gdk_threads_enter();
+ // Gconf is not thread-safe against itself, and it's meant to be
+ // used from the thread running the glib main loop. The proxy
+ // configuration is being fetched from the I/O thread, while the
+ // glib main loop runs in the UI thread. gconf has callbacks,
+ // timeouts and idles that will be dispatched from the glib main
+ // loop. We take this lock to enforce mutual exclusion with the
+ // glib main loop.
+ base::MessagePumpForUI::glib_main_loop_lock_.Acquire();
}
virtual void Leave() {
- gdk_threads_leave();
+ base::MessagePumpForUI::glib_main_loop_lock_.Release();
}
virtual bool InitIfNeeded() {
« no previous file with comments | « chrome/app/chrome_dll_main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698