예제 #1
0
void sock_fab_remove_from_list(struct sock_fabric *fabric)
{
	fastlock_acquire(&sock_list_lock);
	if (sock_fab_check_list_internal(fabric))
		dlist_remove(&fabric->fab_list_entry);

	fastlock_release(&sock_list_lock);
}
예제 #2
0
static inline void rxd_release_unexp_entry(struct rxd_cq *cq,
					    struct fi_cq_msg_entry *comp)
{
	struct rxd_unexp_cq_entry *unexp;
	unexp = container_of(comp, struct rxd_unexp_cq_entry, cq_entry);
	dlist_remove(&unexp->entry);
	util_buf_release(cq->unexp_pool, unexp);
}
예제 #3
0
파일: xcb-dp2.c 프로젝트: lbustc/xcube
/* FIXME */
static void remove_from_clients(client c) {
	dlist_node_t node;

	dlist_lock(clients);
	if ((node = dlist_find(clients, c)))
		dlist_remove(clients, node);
	dlist_unlock(clients);
}
예제 #4
0
void sock_dom_remove_from_list(struct sock_domain *domain)
{
	fastlock_acquire(&sock_list_lock);
	if (sock_dom_check_list_internal(domain))
		dlist_remove(&domain->dom_list_entry);

	fastlock_release(&sock_list_lock);
}
예제 #5
0
파일: xcb-dp2.c 프로젝트: lbustc/xcube
/* FIXME */
static void remove_from_monitors(client c) {
	dlist_node_t node;

	dlist_rwlock_wrlock(monitors);
	if ((node = dlist_find(monitors, c)))
		dlist_remove(monitors, node);
	dlist_rwlock_unlock(monitors);
}
예제 #6
0
파일: ksystime.c 프로젝트: alexeyk13/rexos
void ksystime_timer_stop_internal(KTIMER* timer)
{
    if (timer->active)
    {
        dlist_remove((DLIST**)&__KERNEL->timers, (DLIST*)timer);
        timer->active = false;
    }
}
예제 #7
0
static inline void __gnix_ht_delete_entry(gnix_ht_entry_t *ht_entry)
{
	dlist_remove(&ht_entry->entry);

	ht_entry->value = NULL;
	ht_entry->key = 0;
	free(ht_entry);
}
예제 #8
0
파일: custom.c 프로젝트: wangdkchina/xcb
/* FIXME */
void uall_command(client c) {
	dstr res = get_indices();
	dstr *fields = NULL;
	int nfield = 0, i;

	RTRIM(res);
	fields = dstr_split_len(res, dstr_length(res), ",", 1, &nfield);
	for (i = 1; i < nfield; ++i) {
		dstr pkey = dstr_new(fields[i]);
		dstr skey = dstr_new(pkey);
		dlist_t dlist;

		table_rwlock_wrlock(subscribers);
		if ((dlist = table_get_value(subscribers, pkey))) {
			struct kvd *kvd;

			if (NEW(kvd)) {
				dlist_node_t node, node2;

				kvd->key = skey;
				if ((node = dlist_find(dlist, kvd))) {
					FREE(kvd);
					kvd = (struct kvd *)dlist_node_value(node);
					if ((node2 = dlist_find(kvd->u.dlist, c)))
						dlist_remove(kvd->u.dlist, node2);
					if (dlist_length(kvd->u.dlist) == 0) {
						dlist_remove(dlist, node);
						kdfree(kvd);
					}
					if (dlist_length(dlist) == 0) {
						table_remove(subscribers, pkey);
						dlist_free(&dlist);
					}
				} else
					FREE(kvd);
			} else
				add_reply_error(c, "error allocating memory for kvd");
		}
		table_rwlock_unlock(subscribers);
		dstr_free(skey);
		dstr_free(pkey);
	}
	add_reply_string(c, "\r\n", 2);
	dstr_free(res);
}
예제 #9
0
파일: evio.c 프로젝트: semenovf/cwt
void cwt_remove_channel_listener( CHANNEL_PTR chan )
{
	DListNode* pNode = dlist_find(&__channel_list, chan);

	if( pNode ) {
		dlist_remove(&__channel_list, pNode);
		JQ_FREE(pNode);
	}
}
예제 #10
0
void rxd_rx_entry_release(struct rxd_ep *ep, struct rxd_rx_entry *rx_entry)
{
	rx_entry->key = -1;
	dlist_remove(&rx_entry->entry);
	freestack_push(ep->rx_entry_fs, rx_entry);

	if (ep->credits && !dlist_empty(&ep->wait_rx_list))
		rxd_check_waiting_rx(ep);
}
예제 #11
0
//删除所有节点,利用init函数的destroy函数来清理内存
void dlist_destroy(DList* list)
{
	void *data;
	while((dlist_size(list))>0){
		if(dlist_remove(list,dlist_tail(list),(void **)&data)==0
				&& list->destroy != NULL){
			list->destroy(data);
		}
	}
}
예제 #12
0
static void __gnix_vc_cancel(struct gnix_vc *vc)
{
	struct gnix_nic *nic = vc->ep->nic;

	fastlock_acquire(&nic->rx_vc_lock);
	if (!dlist_empty(&vc->rx_list))
		dlist_remove(&vc->rx_list);
	fastlock_release(&nic->rx_vc_lock);

	fastlock_acquire(&nic->work_vc_lock);
	if (!dlist_empty(&vc->work_list))
		dlist_remove(&vc->work_list);
	fastlock_release(&nic->work_vc_lock);

	fastlock_acquire(&nic->tx_vc_lock);
	if (!dlist_empty(&vc->tx_list))
		dlist_remove(&vc->tx_list);
	fastlock_release(&nic->tx_vc_lock);
}
예제 #13
0
파일: epoll.c 프로젝트: Stan1990/KendyNet
int32_t epoll_unregister(poller_t e,socket_t s)
{
	assert(e);assert(s);
	struct epoll_event ev;int32_t ret;
	TEMP_FAILURE_RETRY(ret = epoll_ctl(e->poller_fd,EPOLL_CTL_DEL,s->fd,&ev));
	s->readable = s->writeable = 0;
    dlist_remove((struct dnode*)s);
	s->engine = NULL;
	return ret;
}
예제 #14
0
파일: semC.c 프로젝트: WangDongfang/DfewOS
/*==============================================================================
 * - semC_remove()
 *
 * - when task delete, remove the task tcb from a semC's wait list
 */
OS_STATUS semC_remove (SEM_CNT *pSemC, OS_TCB *pTcb)
{
    int cpsr_c;

    cpsr_c = CPU_LOCK();
    dlist_remove (&pSemC->wait_list, (DL_NODE *)pTcb);
    CPU_UNLOCK(cpsr_c);

    return OS_STATUS_OK;
}
예제 #15
0
파일: list.c 프로젝트: Engma90/labs
void dlist_destroy(DList *list)
{
    void *data;
    while (dlist_size(list) > 0){
        if (dlist_remove(list, dlist_tail(list), (void**)&data) == 0 && list->destroy != NULL){
            //saukiam vartotojo nustatyta funkcija destroy dinaminei atminciai atlaisvinti
            list->destroy(data);
        }
    }
}
예제 #16
0
파일: dlist.c 프로젝트: fatman2021/byok
void dlist_destroy(dlist_t *list)
{
    void *data;
    while (dlist_size(list) > 0)
    {
        if (dlist_remove(list, dlist_tail(list), (void **)&data) == 0 && list->destroy != NULL)
            list->destroy(data);
    }
    memset(list, 0, sizeof(dlist_t));
}
예제 #17
0
static int psmx2_sep_close(fid_t fid)
{
	struct psmx2_fid_sep *sep;
	struct psmx2_ep_name ep_name;
	int i;

	sep = container_of(fid, struct psmx2_fid_sep, ep.fid);

	if (ofi_atomic_get32(&sep->ref))
		return -FI_EBUSY;

	for (i = 0; i < sep->ctxt_cnt; i++) {
		if (sep->ctxts[i].ep && ofi_atomic_get32(&sep->ctxts[i].ep->ref))
			return -FI_EBUSY;
	}

	ep_name.epid = sep->ctxts[0].trx_ctxt->psm2_epid;
	ep_name.sep_id = sep->id;
	ep_name.type = sep->type;

	ofi_ns_del_local_name(&sep->domain->fabric->name_server,
			      &sep->service, &ep_name);

	for (i = 0; i < sep->ctxt_cnt; i++) {
		psmx2_lock(&sep->domain->trx_ctxt_lock, 1);
		dlist_remove(&sep->ctxts[i].trx_ctxt->entry);
		psmx2_unlock(&sep->domain->trx_ctxt_lock, 1);

		if (sep->ctxts[i].ep)
			psmx2_ep_close_internal(sep->ctxts[i].ep);

		psmx2_trx_ctxt_free(sep->ctxts[i].trx_ctxt);
	}

	psmx2_lock(&sep->domain->sep_lock, 1);
	dlist_remove(&sep->entry);
	psmx2_unlock(&sep->domain->sep_lock, 1);

	psmx2_domain_release(sep->domain);
	free(sep);
	return 0;
}
예제 #18
0
void connline_close(struct connline_context *context)
{
	if (context == NULL || is_connline_initialized() == false)
		return;

	__connline_close(context);
	dbus_connection_unref(context->dbus_cnx);

	contexts_list = dlist_remove(contexts_list, context);
	free(context);
}
예제 #19
0
파일: dlist.c 프로젝트: xynhcwg/impc
void dlist_destroy(Dlist *dlist)
{
	void *data;
	while(dlist_size(dlist)>0)
	{
		if(dlist_remove(dlist,dlist_head(dlist),(void **)&data)==0 && dlist->destroy != NULL)
			dlist->destroy(data);
	}
	memset(dlist,0,sizeof(Dlist));
	return ;
}
예제 #20
0
파일: msgque.c 프로젝트: benjiam/KendyNet
void   msgque_removeinterrupt(msgque_t que)
{
	ptq_t ptq = get_per_thread_que(que,MSGQ_READ);
	if(ptq->read_que.bnode.next || ptq->read_que.bnode.pre){
		mutex_lock(que->mtx);
        dlist_remove(&ptq->read_que.bnode);
		mutex_unlock(que->mtx);
	}
	ptq->read_que.ud = NULL;
	ptq->read_que.notify_function = NULL;
}
예제 #21
0
void pe_entry_release(struct tcpx_pe_entry *pe_entry)
{
	struct tcpx_domain *domain;

	domain = container_of(pe_entry->ep->util_ep.domain,
			      struct tcpx_domain, util_domain);

	memset(&pe_entry->msg_hdr, 0, sizeof(pe_entry->msg_hdr));
	dlist_remove(&pe_entry->entry);
	memset(pe_entry, 0, sizeof(*pe_entry));
	util_buf_release(domain->progress.pe_entry_pool, pe_entry);
}
예제 #22
0
/*==============================================================================
 * - cbi_unregister()
 *
 * - remove a cbi from list, and free it's memory, but not erase the pic
 */
OS_STATUS cbi_unregister (GUI_CBI *pCBI)
{
    if (dlist_check (&_G_cbi_list, (DL_NODE *)pCBI)) {
        dlist_remove (&_G_cbi_list, (DL_NODE *)pCBI);
        if (pCBI->data != NULL) {
            free (pCBI->data);
        }
        free (pCBI);
    }

    return OS_STATUS_OK;
}
예제 #23
0
파일: list.c 프로젝트: seankerr/codebox
void* dlist_remove_ts (DList* list, int32_t index) {
    assert(NULL != list);
    assert(0 <= index);
    assert(NULL != list->mutex);

    pthread_mutex_lock(list->mutex);

    void* ret = dlist_remove(list, index);

    pthread_mutex_unlock(list->mutex);

    return ret;
}
예제 #24
0
파일: ds_dlist.c 프로젝트: Rainwin2015/C
// destroy a list by removing all the elements
void dlist_destroy (DList *list)
{
    void *data;

    while (dlist_size(list) > 0) {
        if ((dlist_remove(list, dlist_tail(list), (void **)&data)) == 0 && list-destroy != NULL) {
            list->destroy (data);
        }
    }

    memset (list, 0, sizeof(DList));
    return;
}
예제 #25
0
void* htable_store(htable_t* ht, void* node)
{
	htable_node_t* tnode = (htable_node_t*)node;
	dlist_t* bucket = get_bucket(ht, tnode);
	dlist_node_t* old_node = dlist_find(bucket, node, ht->do_compare);
	if (old_node) {
	    dlist_remove(bucket, old_node);
	}
	tnode->bucket = bucket;
    dlist_add(bucket, node);

	return old_node;
}
예제 #26
0
void input_history_prune(struct input *input) {
	dlist_t *cur = input->history_end;

	while (input->history_len > input->max_history_len && cur != NULL) {
		dlist_t *prev = cur->prev;

		free(cur->data);
		dlist_remove(input->history, cur);
		input->history_len--;
		cur = prev;
	}

	input->history_end = cur;
}
예제 #27
0
int ofi_domain_close(struct util_domain *domain)
{
	if (ofi_atomic_get32(&domain->ref))
		return -FI_EBUSY;

	fastlock_acquire(&domain->fabric->lock);
	dlist_remove(&domain->list_entry);
	fastlock_release(&domain->fabric->lock);

	free(domain->name);
	fastlock_destroy(&domain->lock);
	ofi_atomic_dec32(&domain->fabric->ref);
	return 0;
}
예제 #28
0
void dlist_destroy(DList *list)
{
    /* Destroy the double list */
    void    *data;
    while(dlist_size(list) != 0) {
        if (dlist_remove(list, dlist_tail(list), (void **)&data) == 0 && 
            list->destroy != NULL) {
            list->destroy(data);
        }
    }

    memset(list, 0, sizeof(DList));
    return;
}
예제 #29
0
/* dlist_destroy */
void dlist_destroy(Dlist *list) {
    void *data;
    /* Remove each element. */
    while(dlist_size(list) > 0) {
        if(dlist_remove(list, dlist_tail(list), (void **)&data) == 0 && list->destroy != NULL) {
            /* call a user-defined function to free dynamically allocated data. */
            list->destroy(data);
        }
    }

    /* no operations are allowed now, but clear the structure as a precaution. */
    memset(list, 0, sizeof(DList));
    return;
}
예제 #30
0
void rxd_tx_entry_done(struct rxd_ep *ep, struct rxd_tx_entry *tx_entry)
{
	struct rxd_pkt_meta *pkt_meta;
	struct dlist_entry *item;

	while (!dlist_empty(&tx_entry->pkt_list)) {
		item = tx_entry->pkt_list.next;
		pkt_meta = container_of(item, struct rxd_pkt_meta, entry);
		dlist_remove(&pkt_meta->entry);
		RXD_PKT_MARK_REMOTE_ACK(pkt_meta);
		rxd_tx_pkt_release(pkt_meta);
	}
	rxd_tx_entry_release(ep, tx_entry);
}