[glib] notify: Readd g_object_notify_queue_from_object()



commit 2819dd60b7b2feaa0609c1017e20105852ca92e4
Author: Benjamin Otte <otte redhat com>
Date:   Fri Jul 23 10:49:26 2010 +0200

    notify: Readd g_object_notify_queue_from_object()
    
    gobjectnotifyqueue.c is a public header, so we cannot remove files from
    it. (Yes you read that right, this .c file is a public header. See your
    installation directory.)

 gobject/gobjectnotifyqueue.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gobject/gobjectnotifyqueue.c b/gobject/gobjectnotifyqueue.c
index bf4d301..e54e3f7 100644
--- a/gobject/gobjectnotifyqueue.c
+++ b/gobject/gobjectnotifyqueue.c
@@ -170,6 +170,17 @@ g_object_notify_queue_add (GObject            *object,
     }
 }
 
+/* NB: This function is not threadsafe, do not ever use it if
+ * you need a threadsafe notify queue.
+ * Use g_object_notify_queue_freeze() to acquire the queue and
+ * g_object_notify_queue_thaw() after you are done instead.
+ */
+static inline GObjectNotifyQueue*
+g_object_notify_queue_from_object (GObject              *object,
+                                   GObjectNotifyContext *context)
+{
+  return g_datalist_id_get_data (&object->qdata, context->quark_notify_queue);
+}
 
 G_END_DECLS
 



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