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)
88 #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);
96 static dbus_int32_t notify_user_data_slot = -1;
110 int timeout_milliseconds,
116 _dbus_assert (timeout_milliseconds >= 0 || timeout_milliseconds == -1);
118 if (timeout_milliseconds == -1)
119 timeout_milliseconds = _DBUS_DEFAULT_TIMEOUT_VALUE;
158 _dbus_pending_call_trace_ref (pending, 0, 1,
"new_unlocked");
183 _dbus_verbose (
" handing message %p (%s) to pending call serial %u\n",
188 "error" :
"other type",
193 pending->
reply = message;
214 notify_user_data_slot);
216 (* pending->
function) (pending, user_data);
308 dbus_uint32_t serial)
356 dbus_uint32_t serial)
362 "Did not receive a reply. Possible causes include: "
363 "the remote application did not send a reply, "
364 "the message bus security policy blocked the reply, "
365 "the reply timeout expired, or "
366 "the network connection was broken.");
371 if (reply_link ==
NULL)
396 dbus_int32_t old_refcount;
399 _dbus_pending_call_trace_ref (pending, old_refcount, old_refcount + 1,
459 dbus_int32_t old_refcount;
463 _dbus_pending_call_trace_ref (pending, old_refcount,
464 old_refcount - 1,
"unref_and_unlock");
468 if (old_refcount == 1)
469 _dbus_pending_call_last_unref (pending);
513 slot, data, free_data_func,
514 &old_free_func, &old_data);
522 (* old_free_func) (old_data);
579 dbus_int32_t old_refcount;
581 _dbus_return_val_if_fail (pending !=
NULL,
NULL);
584 _dbus_pending_call_trace_ref (pending, old_refcount, old_refcount + 1,
599 dbus_int32_t old_refcount;
601 _dbus_return_if_fail (pending !=
NULL);
604 _dbus_pending_call_trace_ref (pending, old_refcount, old_refcount - 1,
607 if (old_refcount == 1)
608 _dbus_pending_call_last_unref(pending);
629 _dbus_return_val_if_fail (pending !=
NULL,
FALSE);
635 user_data, free_user_data))
665 _dbus_return_if_fail (pending !=
NULL);
683 _dbus_return_val_if_fail (pending !=
NULL,
FALSE);
706 _dbus_return_val_if_fail (pending !=
NULL,
NULL);
712 message = pending->
reply;
717 _dbus_message_trace_ref (message, -1, -1,
"dbus_pending_call_steal_reply");
739 _dbus_return_if_fail (pending !=
NULL);
761 _dbus_return_val_if_fail (slot_p !=
NULL,
FALSE);
781 _dbus_return_if_fail (slot_p !=
NULL);
782 _dbus_return_if_fail (*slot_p >= 0);
808 _dbus_return_val_if_fail (pending !=
NULL,
FALSE);
809 _dbus_return_val_if_fail (slot >= 0,
FALSE);
832 _dbus_return_val_if_fail (pending !=
NULL,
NULL);