Index: gobject/gobject.c
===================================================================
--- gobject/gobject.c	(Revision 6879)
+++ gobject/gobject.c	(Arbeitskopie)
@@ -123,6 +123,8 @@
 G_LOCK_DEFINE_STATIC (construction_mutex);
 static GSList *construction_objects = NULL;
 
+static GStaticRecMutex notify_mutex = G_STATIC_REC_MUTEX_INIT;
+
 /* --- functions --- */
 #ifdef	G_ENABLE_DEBUG
 #define	IF_DEBUG(debug_type)	if (_g_type_debug_flags & G_TYPE_DEBUG_ ## debug_type)
@@ -481,6 +483,7 @@
   g_datalist_init (&object->qdata);
   
   /* freeze object's notification queue, g_object_newv() preserves pairedness */
+  g_static_rec_mutex_lock (&notify_mutex);
   g_object_notify_queue_freeze (object, &property_notify_context);
   /* enter construction list for notify_queue_thaw() and to allow construct-only properties */
   G_LOCK (construction_mutex);
@@ -496,6 +499,7 @@
       G_UNLOCK (debug_objects);
     }
 #endif	/* G_ENABLE_DEBUG */
+  g_static_rec_mutex_unlock (&notify_mutex);
 }
 
 static void
@@ -582,9 +586,11 @@
   if (g_atomic_int_get (&object->ref_count) == 0)
     return;
 
+  g_static_rec_mutex_lock (&notify_mutex);
   g_object_ref (object);
   g_object_notify_queue_freeze (object, &property_notify_context);
   g_object_unref (object);
+  g_static_rec_mutex_unlock (&notify_mutex);
 }
 
 void
@@ -617,9 +623,11 @@
     {
       GObjectNotifyQueue *nqueue;
       
+      g_static_rec_mutex_lock (&notify_mutex);
       nqueue = g_object_notify_queue_freeze (object, &property_notify_context);
       g_object_notify_queue_add (object, nqueue, pspec);
       g_object_notify_queue_thaw (object, nqueue);
+      g_static_rec_mutex_unlock (&notify_mutex);
     }
   g_object_unref (object);
 }
@@ -633,6 +641,7 @@
   if (g_atomic_int_get (&object->ref_count) == 0)
     return;
   
+  g_static_rec_mutex_lock (&notify_mutex);
   g_object_ref (object);
   nqueue = g_object_notify_queue_from_object (object, &property_notify_context);
   if (!nqueue || !nqueue->freeze_count)
@@ -641,6 +650,7 @@
   else
     g_object_notify_queue_thaw (object, nqueue);
   g_object_unref (object);
+  g_static_rec_mutex_unlock (&notify_mutex);
 }
 
 static inline void
@@ -945,8 +955,11 @@
   G_LOCK (construction_mutex);
   newly_constructed = slist_maybe_remove (&construction_objects, object);
   G_UNLOCK (construction_mutex);
-  if (newly_constructed || n_oparams)
+  
+  if (newly_constructed || n_oparams) {
+    g_static_rec_mutex_lock (&notify_mutex);
     nqueue = g_object_notify_queue_freeze (object, &property_notify_context);
+  }
   if (newly_constructed)
     g_object_notify_queue_thaw (object, nqueue);
 
@@ -960,8 +973,10 @@
   g_free (oparams);
 
   /* release our own freeze count and handle notifications */
-  if (newly_constructed || n_oparams)
+  if (newly_constructed || n_oparams) {
     g_object_notify_queue_thaw (object, nqueue);
+    g_static_rec_mutex_unlock (&notify_mutex);
+  }
 
   if (unref_class)
     g_type_class_unref (unref_class);
@@ -1048,7 +1063,10 @@
   /* set construction parameters */
   if (n_construct_properties)
     {
-      GObjectNotifyQueue *nqueue = g_object_notify_queue_freeze (object, &property_notify_context);
+      GObjectNotifyQueue *nqueue;
+
+      g_static_rec_mutex_lock (&notify_mutex);
+      nqueue = g_object_notify_queue_freeze (object, &property_notify_context);
       
       /* set construct properties */
       while (n_construct_properties--)
@@ -1060,6 +1078,7 @@
 	  object_set_property (object, pspec, value, nqueue);
 	}
       g_object_notify_queue_thaw (object, nqueue);
+      g_static_rec_mutex_unlock (&notify_mutex);
       /* the notification queue is still frozen from g_object_init(), so
        * we don't need to handle it here, g_object_newv() takes
        * care of that
@@ -1079,6 +1098,7 @@
   
   g_return_if_fail (G_IS_OBJECT (object));
   
+  g_static_rec_mutex_lock (&notify_mutex);
   g_object_ref (object);
   nqueue = g_object_notify_queue_freeze (object, &property_notify_context);
   
@@ -1135,6 +1155,7 @@
 
   g_object_notify_queue_thaw (object, nqueue);
   g_object_unref (object);
+  g_static_rec_mutex_unlock (&notify_mutex);
 }
 
 void
@@ -1240,6 +1261,7 @@
   g_return_if_fail (property_name != NULL);
   g_return_if_fail (G_IS_VALUE (value));
   
+  g_static_rec_mutex_lock (&notify_mutex);
   g_object_ref (object);
   nqueue = g_object_notify_queue_freeze (object, &property_notify_context);
   
@@ -1265,6 +1287,7 @@
   
   g_object_notify_queue_thaw (object, nqueue);
   g_object_unref (object);
+  g_static_rec_mutex_unlock (&notify_mutex);
 }
 
 void
