25 #include "dbus-internals.h"
26 #include "dbus-connection-internal.h"
27 #include "dbus-message-internal.h"
28 #include "dbus-pending-call-internal.h"
29 #include "dbus-pending-call.h"
30 #include "dbus-list.h"
31 #include "dbus-threads.h"
32 #include "dbus-test.h"
53 #define CONNECTION_LOCK(connection) _dbus_connection_lock(connection)
57 #define CONNECTION_UNLOCK(connection) _dbus_connection_unlock(connection)
96 #ifdef DBUS_ENABLE_VERBOSE_MODE
97 static int enabled = -1;
99 _dbus_trace_ref (
"DBusPendingCall", pending_call, old_refcount,
100 new_refcount, why,
"DBUS_PENDING_CALL_TRACE", &enabled);
118 int timeout_milliseconds,
124 _dbus_assert (timeout_milliseconds >= 0 || timeout_milliseconds == -1);
126 if (timeout_milliseconds == -1)
127 timeout_milliseconds = _DBUS_DEFAULT_TIMEOUT_VALUE;
166 _dbus_pending_call_trace_ref (pending, 0, 1,
"new_unlocked");
191 _dbus_verbose (
" handing message %p (%s) to pending call serial %u\n",
196 "error" :
"other type",
201 pending->
reply = message;
240 notify_user_data_slot);
242 (* pending->
function) (pending, user_data);
388 "Did not receive a reply. Possible causes include: "
389 "the remote application did not send a reply, "
390 "the message bus security policy blocked the reply, "
391 "the reply timeout expired, or "
392 "the network connection was broken.");
397 if (reply_link ==
NULL)
425 _dbus_pending_call_trace_ref (pending, old_refcount, old_refcount + 1,
489 _dbus_pending_call_trace_ref (pending, old_refcount,
490 old_refcount - 1,
"unref_and_unlock");
494 if (old_refcount == 1)
495 _dbus_pending_call_last_unref (pending);
539 slot, data, free_data_func,
540 &old_free_func, &old_data);
548 (* old_free_func) (old_data);
607 _dbus_return_val_if_fail (pending !=
NULL,
NULL);
610 _dbus_pending_call_trace_ref (pending, old_refcount, old_refcount + 1,
627 _dbus_return_if_fail (pending !=
NULL);
630 _dbus_pending_call_trace_ref (pending, old_refcount, old_refcount - 1,
633 if (old_refcount == 1)
634 _dbus_pending_call_last_unref(pending);
655 _dbus_return_val_if_fail (pending !=
NULL,
FALSE);
661 user_data, free_user_data))
691 _dbus_return_if_fail (pending !=
NULL);
709 _dbus_return_val_if_fail (pending !=
NULL,
FALSE);
732 _dbus_return_val_if_fail (pending !=
NULL,
NULL);
738 message = pending->
reply;
743 _dbus_message_trace_ref (message, -1, -1,
"dbus_pending_call_steal_reply");
765 _dbus_return_if_fail (pending !=
NULL);
787 _dbus_return_val_if_fail (slot_p !=
NULL,
FALSE);
807 _dbus_return_if_fail (slot_p !=
NULL);
808 _dbus_return_if_fail (*slot_p >= 0);
834 _dbus_return_val_if_fail (pending !=
NULL,
FALSE);
835 _dbus_return_val_if_fail (slot >= 0,
FALSE);
858 _dbus_return_val_if_fail (pending !=
NULL,
NULL);