Re: [Nautilus-list] g_thread_init patch



On 16 Apr 2001 11:42:14 -0700, Mike Fleming wrote:
> Remco:  The Nautilus coding style dictates that you need to always use
> braces around code blocks after "if"'s and "while"'s, etc


Ok, I attached a new patch that uses braces.
 

> So g_thread_supported() returns FALSE until the first g_thread_init()
> call?

Yep.

Remco
diff -urN nautilus-original/components/adapter/main.c nautilus/components/adapter/main.c
--- nautilus-original/components/adapter/main.c	Tue Apr 17 00:20:34 2001
+++ nautilus/components/adapter/main.c	Tue Apr 17 00:25:24 2001
@@ -106,7 +106,11 @@
 	/* Initialize libraries. */
         gnome_init ("nautilus-adapter", VERSION, 
 		    argc, argv); 
-	g_thread_init (NULL);
+
+	if (!g_thread_supported()) {
+		g_thread_init (NULL);
+	}
+
 	gnome_vfs_init ();
 	bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
 
diff -urN nautilus-original/components/hardware/main.c nautilus/components/hardware/main.c
--- nautilus-original/components/hardware/main.c	Tue Apr 17 00:20:33 2001
+++ nautilus/components/hardware/main.c	Tue Apr 17 00:24:49 2001
@@ -87,7 +87,10 @@
 	bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
 
 	/* initialize gnome-vfs, etc */
-	g_thread_init (NULL);
+	if (!g_thread_supported()) {
+		g_thread_init (NULL);
+	}
+
 	gnome_vfs_init ();
 
         registration_id = oaf_make_registration_id ("OAFIID:nautilus_hardware_view_factory:8c80e55a-5c03-4403-9e51-3a5711b8a5ce", 
diff -urN nautilus-original/components/rpmview/main.c nautilus/components/rpmview/main.c
--- nautilus-original/components/rpmview/main.c	Tue Apr 17 00:20:33 2001
+++ nautilus/components/rpmview/main.c	Tue Apr 17 00:24:20 2001
@@ -85,7 +85,10 @@
 	bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
 
 	/* initialize gnome-vfs, etc */
-	g_thread_init (NULL);
+	if (!g_thread_supported()) {
+		g_thread_init (NULL);
+	}
+
 	gnome_vfs_init ();
 	
         registration_id = oaf_make_registration_id ("OAFIID:nautilus_rpm_view_factory:5986d6a5-8840-44ea-84a1-e7f052bd85cf", getenv ("DISPLAY"));
diff -urN nautilus-original/components/services/summary/main.c nautilus/components/services/summary/main.c
--- nautilus-original/components/services/summary/main.c	Tue Apr 17 00:20:37 2001
+++ nautilus/components/services/summary/main.c	Tue Apr 17 00:26:05 2001
@@ -98,7 +98,11 @@
 	gdk_rgb_init ();
 
 	eel_setenv ("GNOME_VFS_HTTP_USER_AGENT", trilobite_get_useragent_string (NULL), 1);
-	g_thread_init (NULL);
+
+	if (!g_thread_supported()) {
+		g_thread_init (NULL);
+	}
+
 	gnome_vfs_init ();
 
 	bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
diff -urN nautilus-original/components/throbber/main.c nautilus/components/throbber/main.c
--- nautilus-original/components/throbber/main.c	Tue Apr 17 00:20:38 2001
+++ nautilus/components/throbber/main.c	Tue Apr 17 00:26:24 2001
@@ -108,7 +108,10 @@
 	bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
 
 	/* initialize gnome-vfs, etc */
-	g_thread_init (NULL);
+	if (!g_thread_supported()) {
+		g_thread_init (NULL);
+	}
+
 	gnome_vfs_init ();
 	nautilus_global_preferences_initialize ();   
 	
diff -urN nautilus-original/libnautilus/nautilus-view-standard-main.c nautilus/libnautilus/nautilus-view-standard-main.c
--- nautilus-original/libnautilus/nautilus-view-standard-main.c	Tue Apr 17 00:20:42 2001
+++ nautilus/libnautilus/nautilus-view-standard-main.c	Tue Apr 17 00:26:48 2001
@@ -120,7 +120,11 @@
         gnome_init (executable_name, version, 
 		    argc, argv); 
 	gdk_rgb_init ();
-	g_thread_init (NULL);
+
+	if (!g_thread_supported()) {
+		g_thread_init (NULL);
+	}
+
 	gnome_vfs_init ();
 	bonobo_init (orb, CORBA_OBJECT_NIL, CORBA_OBJECT_NIL);
 
diff -urN nautilus-original/src/nautilus-main.c nautilus/src/nautilus-main.c
--- nautilus-original/src/nautilus-main.c	Tue Apr 17 00:20:20 2001
+++ nautilus/src/nautilus-main.c	Tue Apr 17 00:22:57 2001
@@ -229,7 +229,10 @@
 	/* Initialize the services that we use. */
 	LIBXML_TEST_VERSION
 	g_atexit (xmlCleanupParser);
-	g_thread_init (NULL);
+
+	if (!g_thread_supported()) {
+		g_thread_init (NULL);
+	}
 
 	if (g_getenv ("NAUTILUS_ENABLE_TEST_COMPONENTS") != NULL) {
 		oaf_set_test_components_enabled (TRUE);
diff -urN nautilus-original/test/test-nautilus-mime-actions-set.c nautilus/test/test-nautilus-mime-actions-set.c
--- nautilus-original/test/test-nautilus-mime-actions-set.c	Tue Apr 17 00:20:24 2001
+++ nautilus/test/test-nautilus-mime-actions-set.c	Tue Apr 17 00:23:53 2001
@@ -113,7 +113,10 @@
 	gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());
 	oaf_init (argc, argv);
 
-	g_thread_init (NULL);
+	if (!g_thread_supported()) {
+		g_thread_init (NULL);
+	}
+
 	gnome_vfs_init ();
 	gnome_init ("test-nautilus-mime-actions-set", "0.0",
 		    argc, argv);
diff -urN nautilus-original/test/test-nautilus-mime-actions.c nautilus/test/test-nautilus-mime-actions.c
--- nautilus-original/test/test-nautilus-mime-actions.c	Tue Apr 17 00:20:24 2001
+++ nautilus/test/test-nautilus-mime-actions.c	Tue Apr 17 00:23:33 2001
@@ -154,7 +154,10 @@
 	NautilusFile *file;
 	GList *attributes;
 
-	g_thread_init (NULL);
+	if (!g_thread_supported()) {
+		g_thread_init (NULL);
+	}
+
 	gnome_vfs_init ();
 
 	gnomelib_register_popt_table (oaf_popt_options, oaf_get_popt_table_name ());


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