summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-25 01:50:52 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-25 01:50:52 +0000
commit7dc21e5c1d739c3c263abaf86b953a4d022ba538 (patch)
treef76c1cb65c1a6d508236d2aa1d173f5478adebec /chrome
parent4c3030ff6a6e15798d7d52a40e52de7d86db4057 (diff)
downloadchromium_src-7dc21e5c1d739c3c263abaf86b953a4d022ba538.zip
chromium_src-7dc21e5c1d739c3c263abaf86b953a4d022ba538.tar.gz
chromium_src-7dc21e5c1d739c3c263abaf86b953a4d022ba538.tar.bz2
linux: call g_thread_init() at relevant startup points
According to glib docs, we need to do this if it's at all possible for us to hit glib on multiple threads. This may be happening when we grab plugin metadata from the file thread. Rather than explicitly depending on gthread all over the place, just put it in with the GTK dep (since anywhere we're using GTK we ought to init gthread). (Note that this is *not* initializing the GDK locking system.) BUG=18957 Review URL: http://codereview.chromium.org/174264 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24207 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/chrome_dll_main.cc1
-rw-r--r--chrome/chrome.gyp2
-rw-r--r--chrome/plugin/plugin_thread.cc1
3 files changed, 2 insertions, 2 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index 1783117..792d0ad 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -554,6 +554,7 @@ int ChromeMain(int argc, const char** argv) {
#endif
} else if (process_type.empty()) {
#if defined(OS_LINUX)
+ g_thread_init(NULL);
// Glib type system initialization. Needed at least for gconf,
// used in net/proxy/proxy_config_service_linux.cc. Most likely
// this is superfluous as gtk_init() ought to do this. It's
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 2ed58c8..c368821 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -3046,8 +3046,6 @@
'<@(chromium_dependencies)',
# Needed for chrome_dll_main.cc #include of gtk/gtk.h
'../build/linux/system.gyp:gtk',
- # Needed for chrome_dll_main.cc use of g_thread_init
- '../build/linux/system.gyp:gthread',
],
'sources': [
'app/chrome_dll_main.cc',
diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc
index ae90e1a..307cbaa 100644
--- a/chrome/plugin/plugin_thread.cc
+++ b/chrome/plugin/plugin_thread.cc
@@ -35,6 +35,7 @@ PluginThread::PluginThread()
{
// XEmbed plugins assume they are hosted in a Gtk application, so we need
// to initialize Gtk in the plugin process.
+ g_thread_init(NULL);
const std::vector<std::string>& args =
CommandLine::ForCurrentProcess()->argv();
int argc = args.size();