Esempio n. 1
0
/** Remove reference from association.
 *
 * Decrease association reference count by one.
 *
 * @param assoc		Association
 */
void udp_assoc_delref(udp_assoc_t *assoc)
{
	log_msg(LVL_DEBUG, "%s: udp_assoc_delref(%p)", assoc->name, assoc);

	if (atomic_predec(&assoc->refcnt) == 0)
		udp_assoc_free(assoc);
}
Esempio n. 2
0
void ipc_call_release(call_t *call)
{
	if (atomic_predec(&call->refcnt) == 0) {
		if (call->buffer)
			free(call->buffer);
		slab_free(ipc_call_slab, call);
	}
}
Esempio n. 3
0
/** Remove reference from connection.
 *
 * Decrease connection reference count by one.
 *
 * @param conn		Connection
 */
void tcp_conn_delref(tcp_conn_t *conn)
{
	log_msg(LOG_DEFAULT, LVL_DEBUG2, "%s: tcp_conn_delref(%p) before=%zu",
	    conn->name, conn, atomic_get(&conn->refcnt));

	if (atomic_predec(&conn->refcnt) == 0)
		tcp_conn_free(conn);
}
Esempio n. 4
0
/**
 * Release a reference to the audio data buffer.
 * @param adata The audio data buffer.
 */
void audio_data_unref(audio_data_t *adata)
{
	assert(adata);
	assert(atomic_get(&adata->refcount) > 0);
	atomic_count_t refc = atomic_predec(&adata->refcount);
	if (refc == 0) {
		free(adata->data);
		free(adata);
	}
}