Revert "notify: Remove unused g_object_notify_queue_clear()"
authorBenjamin Otte <otte@redhat.com>
Fri, 23 Jul 2010 08:51:14 +0000 (10:51 +0200)
committerBenjamin Otte <otte@redhat.com>
Fri, 23 Jul 2010 08:52:51 +0000 (10:52 +0200)
This reverts commit 0201a81f04ae5fd46c6db25859e90dde1fc35d4b and adds
locks in the right place.

As this file is a public header (see last commit), we cannot just remove
functions from it.

gobject/gobjectnotifyqueue.c

index e54e3f7..e53e22b 100644 (file)
@@ -146,6 +146,21 @@ g_object_notify_queue_thaw (GObject            *object,
 }
 
 static inline void
+g_object_notify_queue_clear (GObject            *object,
+                            GObjectNotifyQueue *nqueue)
+{
+  g_return_if_fail (nqueue->freeze_count > 0);
+
+  G_LOCK(notify_lock);
+
+  g_slist_free (nqueue->pspecs);
+  nqueue->pspecs = NULL;
+  nqueue->n_pspecs = 0;
+
+  G_UNLOCK(notify_lock);
+}
+
+static inline void
 g_object_notify_queue_add (GObject            *object,
                           GObjectNotifyQueue *nqueue,
                           GParamSpec         *pspec)