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)
82 #ifdef DBUS_ENABLE_VERBOSE_MODE
89 static int enabled = -1;
91 _dbus_trace_ref (
"DBusPendingCall", pending_call, old_refcount,
92 new_refcount, why,
"DBUS_PENDING_CALL_TRACE", &enabled);
95 #define _dbus_pending_call_trace_ref(p, o, n, w) \
117 int timeout_milliseconds,
123 _dbus_assert (timeout_milliseconds >= 0 || timeout_milliseconds == -1);
125 if (timeout_milliseconds == -1)
126 timeout_milliseconds = _DBUS_DEFAULT_TIMEOUT_VALUE;
165 _dbus_pending_call_trace_ref (pending, 0, 1,
"new_unlocked");
190 _dbus_verbose (
" handing message %p (%s) to pending call serial %u\n",
195 "error" :
"other type",
200 pending->
reply = message;
221 notify_user_data_slot);
223 (* pending->
function) (pending, user_data);
369 "Did not receive a reply. Possible causes include: "
370 "the remote application did not send a reply, "
371 "the message bus security policy blocked the reply, "
372 "the reply timeout expired, or "
373 "the network connection was broken.");
378 if (reply_link ==
NULL)
406 _dbus_pending_call_trace_ref (pending, old_refcount, old_refcount + 1,
470 _dbus_pending_call_trace_ref (pending, old_refcount,
471 old_refcount - 1,
"unref_and_unlock");
475 if (old_refcount == 1)
476 _dbus_pending_call_last_unref (pending);
520 slot, data, free_data_func,
521 &old_free_func, &old_data);
529 (* old_free_func) (old_data);
588 _dbus_return_val_if_fail (pending !=
NULL,
NULL);
591 _dbus_pending_call_trace_ref (pending, old_refcount, old_refcount + 1,
608 _dbus_return_if_fail (pending !=
NULL);
611 _dbus_pending_call_trace_ref (pending, old_refcount, old_refcount - 1,
614 if (old_refcount == 1)
615 _dbus_pending_call_last_unref(pending);
636 _dbus_return_val_if_fail (pending !=
NULL,
FALSE);
642 user_data, free_user_data))
672 _dbus_return_if_fail (pending !=
NULL);
690 _dbus_return_val_if_fail (pending !=
NULL,
FALSE);
713 _dbus_return_val_if_fail (pending !=
NULL,
NULL);
719 message = pending->
reply;
724 _dbus_message_trace_ref (message, -1, -1,
"dbus_pending_call_steal_reply");
746 _dbus_return_if_fail (pending !=
NULL);
768 _dbus_return_val_if_fail (slot_p !=
NULL,
FALSE);
789 _dbus_return_if_fail (slot_p !=
NULL);
790 _dbus_return_if_fail (*slot_p >= 0);
816 _dbus_return_val_if_fail (pending !=
NULL,
FALSE);
817 _dbus_return_val_if_fail (slot >= 0,
FALSE);
840 _dbus_return_val_if_fail (pending !=
NULL,
NULL);