Пример #1
0
static int sock_dom_close(struct fid *fid)
{
	struct sock_domain *dom;
	void *res;
	int c;

	dom = container_of(fid, struct sock_domain, dom_fid.fid);
	if (atomic_get(&dom->ref)) {
		return -FI_EBUSY;
	}

	dom->listening = 0;
	write(dom->signal_fds[0], &c, 1);
	if (pthread_join(dom->listen_thread, &res)) {
		SOCK_LOG_ERROR("could not join listener thread, errno = %d\n", errno);
		return -FI_EBUSY;
	}

	if (dom->r_cmap.size)
		sock_conn_map_destroy(&dom->r_cmap);
	fastlock_destroy(&dom->r_cmap.lock);

	sock_pe_finalize(dom->pe);
	fastlock_destroy(&dom->lock);
	free(dom);
	return 0;
}
Пример #2
0
static int sock_dom_close(struct fid *fid)
{
	struct sock_domain *dom;
	dom = container_of(fid, struct sock_domain, dom_fid.fid);
	if (atomic_get(&dom->ref))
		return -FI_EBUSY;

	sock_pe_finalize(dom->pe);
	fastlock_destroy(&dom->lock);
	rbtDelete(dom->mr_heap);
	sock_dom_remove_from_list(dom);
	free(dom);
	return 0;
}
Пример #3
0
static int sock_dom_close(struct fid *fid)
{
	struct sock_domain *dom;
	dom = container_of(fid, struct sock_domain, dom_fid.fid);
	if (atomic_get(&dom->ref)) {
		return -FI_EBUSY;
	}

	sock_pe_finalize(dom->pe);
	if (dom->r_cmap.size)
		sock_conn_map_destroy(&dom->r_cmap);
	fastlock_destroy(&dom->r_cmap.lock);
	fastlock_destroy(&dom->lock);
	sock_dom_remove_from_list(dom);
	free(dom);
	return 0;
}