summaryrefslogtreecommitdiff
path: root/dbus/dbus-message.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-02-25 17:21:44 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-07-28 18:23:27 +0100
commitab3984d327f83015b0a0a1c7743de583811df760 (patch)
tree6a5c35388218dce8db7360868fe474253169107a /dbus/dbus-message.c
parent6310774e98a51a4a2ec550e39ba3e1a58f2d0caa (diff)
downloaddbus-ab3984d327f83015b0a0a1c7743de583811df760.tar.gz
When attaching counters to messages, don't automatically notify callbacks
In all the places where counters are added, we're under a lock. The caller knows what effect adding the counter might have, and can replicate it in a lock-safe way if necessary. Reviewed-by: Colin Walters <walters@verbum.org> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34393
Diffstat (limited to 'dbus/dbus-message.c')
-rw-r--r--dbus/dbus-message.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/dbus/dbus-message.c b/dbus/dbus-message.c
index 92c8325c..faaf3e19 100644
--- a/dbus/dbus-message.c
+++ b/dbus/dbus-message.c
@@ -218,6 +218,11 @@ dbus_message_set_serial (DBusMessage *message,
* itself not incremented. Ownership of link and counter refcount is
* passed to the message.
*
+ * This function may be called with locks held. As a result, the counter's
+ * notify function is not called; the caller is expected to either call
+ * _dbus_counter_notify() on the counter when they are no longer holding
+ * locks, or take the same action that would be taken by the notify function.
+ *
* @param message the message
* @param link link with counter as data
*/
@@ -254,8 +259,6 @@ _dbus_message_add_counter_link (DBusMessage *message,
#ifdef HAVE_UNIX_FD_PASSING
_dbus_counter_adjust_unix_fd (link->data, message->unix_fd_counter_delta);
#endif
-
- _dbus_counter_notify (link->data);
}
/**
@@ -263,6 +266,11 @@ _dbus_message_add_counter_link (DBusMessage *message,
* of this message, and decremented by the size/unix fds of this
* message when this message if finalized.
*
+ * This function may be called with locks held. As a result, the counter's
+ * notify function is not called; the caller is expected to either call
+ * _dbus_counter_notify() on the counter when they are no longer holding
+ * locks, or take the same action that would be taken by the notify function.
+ *
* @param message the message
* @param counter the counter
* @returns #FALSE if no memory