Index: gobject/tests/threadtests.c
===================================================================
--- gobject/tests/threadtests.c	(revision 6852)
+++ gobject/tests/threadtests.c	(working copy)
@@ -109,6 +109,7 @@
 static void my_tester2_init (MyTester2*t) {}
 static void my_tester2_class_init (MyTester2Class*c) { call_counter_init (c); }
 
+static GCond *sync_cond = NULL;
 static GMutex *sync_mutex = NULL;
 
 static gpointer
@@ -138,7 +139,6 @@
 {
   GThread *threads[3] = { NULL, };
   /* pause newly created threads */
-  sync_mutex = g_mutex_new();
   g_mutex_lock (sync_mutex);
   /* create threads */
   threads[0] = g_thread_create (tester_init_thread, (gpointer) my_tester0_get_type(), TRUE, NULL);
@@ -158,6 +158,65 @@
   g_assert_cmpint (g_atomic_int_get (&mtsafe_call_counter), ==, unsafe_call_counter);
 }
 
+typedef struct {
+  GObject parent;
+  char   *name;
+} PropTester;
+typedef GObjectClass    PropTesterClass;
+G_DEFINE_TYPE (PropTester, prop_tester, G_TYPE_OBJECT);
+#define PROP_NAME 1
+static void prop_tester_init (PropTester* t)
+{
+  if (t->name == NULL)
+    g_test_bug ("race initializing properties");
+}
+static void prop_tester_class_init (PropTesterClass *c)
+{
+  int i;
+  GParamSpec *param;
+  GObjectClass *gobject_class = G_OBJECT_CLASS (c);
+
+  g_mutex_lock (sync_mutex);
+  g_cond_signal (sync_cond);
+  g_mutex_unlock (sync_mutex);
+
+  for (i = 0; i < 100; i++) /* wait a bit. */
+    g_thread_yield();
+
+  call_counter_init (c);
+  param = g_param_spec_string ("name", "name_i18n",
+			       "yet-more-wasteful-i18n",
+			       NULL,
+			       G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE |
+			       G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB |
+			       G_PARAM_STATIC_NICK);
+  g_object_class_install_property (gobject_class, PROP_NAME, param);
+}
+
+static gpointer
+object_create (gpointer data)
+{
+  GObject *obj = g_object_new (prop_tester_get_type(), "name", "fish", NULL);
+  g_object_unref (obj);
+  return NULL;
+}
+
+static void
+test_threaded_object_init (void)
+{
+  GThread *creator;
+  g_mutex_lock (sync_mutex);
+
+  creator = g_thread_create (object_create, NULL, TRUE, NULL);
+  /* really provoke the race */
+  g_cond_wait (sync_cond, sync_mutex);
+
+  object_create (NULL);
+  g_mutex_unlock (sync_mutex);
+
+  g_thread_join (creator);
+}
+
 int
 main (int   argc,
       char *argv[])
@@ -166,7 +225,11 @@
   g_test_init (&argc, &argv, NULL);
   g_type_init ();
 
+  sync_cond = g_cond_new();
+  sync_mutex = g_mutex_new();
+
   g_test_add_func ("/GObject/threaded-class-init", test_threaded_class_init);
+  g_test_add_func ("/GObject/threaded-object-init", test_threaded_object_init);
 
   return g_test_run();
 }
Index: gobject/ChangeLog
===================================================================
--- gobject/ChangeLog	(revision 6852)
+++ gobject/ChangeLog	(working copy)
@@ -1,3 +1,7 @@
+2008-06-10  Michael Meeks  <michael.meeks@novell.com>
+
+	* tests/threadtests.c: add test for bug 537555
+
 2008-03-16  Tor Lillqvist  <tml@novell.com>
 
 	* Makefile.am: Define gobject_def locally here instead of using an
