EXPORT_C #endif void dbus_pending_call_unref (DBusPendingCall *pending) { dbus_bool_t last_unref; _dbus_return_if_fail (pending != NULL); /* More efficient to use the connection lock instead of atomic * int fallback if we lack atomic int decrement */ #ifdef DBUS_HAVE_ATOMIC_INT last_unref = (_dbus_atomic_dec (&pending->refcount) == 1); #else CONNECTION_LOCK (pending->connection); _dbus_assert (pending->refcount.value > 0); pending->refcount.value -= 1; last_unref = pending->refcount.value == 0; CONNECTION_UNLOCK (pending->connection); #endif if (last_unref) _dbus_pending_call_last_unref(pending); }
/** * Decrements the reference count on a pending call, * freeing it if the count reaches 0. * * @param pending the pending call object */ void dbus_pending_call_unref (DBusPendingCall *pending) { dbus_bool_t last_unref; _dbus_return_if_fail (pending != NULL); last_unref = (_dbus_atomic_dec (&pending->refcount) == 1); if (last_unref) _dbus_pending_call_last_unref(pending); }
/** * Decrements the reference count on a pending call, * freeing it if the count reaches 0. Assumes * connection lock is already held. * * @param pending the pending call object */ void _dbus_pending_call_unref_and_unlock (DBusPendingCall *pending) { dbus_int32_t old_refcount; old_refcount = _dbus_atomic_dec (&pending->refcount); _dbus_assert (old_refcount > 0); CONNECTION_UNLOCK (pending->connection); if (old_refcount == 1) _dbus_pending_call_last_unref (pending); }
/** * Decrements the reference count on a pending call, * freeing it if the count reaches 0. Assumes * connection lock is already held. * * @param pending the pending call object */ void _dbus_pending_call_unref_and_unlock (DBusPendingCall *pending) { dbus_bool_t last_unref; _dbus_assert (pending->refcount.value > 0); pending->refcount.value -= 1; last_unref = pending->refcount.value == 0; CONNECTION_UNLOCK (pending->connection); if (last_unref) _dbus_pending_call_last_unref (pending); }
/** * Decrements the reference count on a pending call, * freeing it if the count reaches 0. * * @param pending the pending call object */ void dbus_pending_call_unref (DBusPendingCall *pending) { dbus_int32_t old_refcount; _dbus_return_if_fail (pending != NULL); old_refcount = _dbus_atomic_dec (&pending->refcount); _dbus_pending_call_trace_ref (pending, old_refcount, old_refcount - 1, "unref"); if (old_refcount == 1) _dbus_pending_call_last_unref(pending); }