release/src-rt/linux/linux-2.6/drivers/infiniband/core/iwcm.c
/*
 * Release a reference on cm_id. If the last reference is being
 * released, enable the waiting thread (in iw_destroy_cm_id) to
 * get woken up, and return 1 if a thread is already waiting.
 */
Release a reference on cm_id. If the last reference is being
released, enable the waiting thread (in iw_destroy_cm_id) to
get woken up, and return 1 if a thread is already waiting.
Release a reference on cm_id . If the last reference is being released enable the waiting thread ( in iw_destroy_cm_id ) to get woken up and return 1 if a thread is already waiting .
static int iwcm_deref_id(struct iwcm_id_private *cm_id_priv)
{
	BUG_ON(atomic_read(&cm_id_priv->refcount)==0);
	if (atomic_dec_and_test(&cm_id_priv->refcount)) {
		BUG_ON(!list_empty(&cm_id_priv->work_list));
		complete(&cm_id_priv->destroy_comp);
		return 1;
	}
	return 0;
}
static int iwcm_deref_id ( struct iwcm_id_private * cm_id_priv ) { BUG_ON ( atomic_read ( & cm_id_priv -> refcount ) == 0 ) ; if ( atomic_dec_and_test ( & cm_id_priv -> refcount ) ) { BUG_ON ( ! list_empty ( & cm_id_priv -> work_list ) ) ; complete ( & cm_id_priv -> destroy_comp ) ; return 1 ; } return 0 ; }
Release a reference on cm_id.
Release a reference on cm_id .