当前位置: 首页>>代码示例>>C++>>正文


C++ LIST_DEL函数代码示例

本文整理汇总了C++中LIST_DEL函数的典型用法代码示例。如果您正苦于以下问题:C++ LIST_DEL函数的具体用法?C++ LIST_DEL怎么用?C++ LIST_DEL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了LIST_DEL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: _fenced_buffer_remove

static INLINE void
_fenced_buffer_remove(struct fenced_buffer_list *fenced_list,
                      struct fenced_buffer *fenced_buf)
{
   struct pipe_winsys *winsys = fenced_list->winsys;

   assert(fenced_buf->fence);
   assert(fenced_buf->list == fenced_list);
   
   winsys->fence_reference(winsys, &fenced_buf->fence, NULL);
   fenced_buf->flags &= ~PIPE_BUFFER_USAGE_GPU_READ_WRITE;
   
   assert(fenced_buf->head.prev);
   assert(fenced_buf->head.next);
   LIST_DEL(&fenced_buf->head);
#ifdef DEBUG
   fenced_buf->head.prev = NULL;
   fenced_buf->head.next = NULL;
#endif
   
   assert(fenced_list->numDelayed);
   --fenced_list->numDelayed;
   
   if(!fenced_buf->base.base.refcount)
      _fenced_buffer_destroy(fenced_buf);
}
开发者ID:astrofimov,项目名称:vgallium,代码行数:26,代码来源:pb_buffer_fenced.c

示例2: unvme_session_delete

/**
 * Delete a session and its associated queues.
 * @param   ses         session
 */
static void unvme_session_delete(unvme_session_t* ses)
{
    if (ses->id > 0) {
        pthread_spin_lock(&ses->iomem.lock);
        if (ses->iomem.size) {
            int i;
            for (i = 0; i < ses->iomem.count; i++) {
                (void) vfio_dma_free(ses->iomem.map[i]);
            }
            ses->iomem.size = ses->iomem.count = 0;
            free(ses->iomem.map);
        }
        pthread_spin_unlock(&ses->iomem.lock);
        pthread_spin_destroy(&ses->iomem.lock);
    }

    if (ses == ses->next) {
        DEBUG_FN("%x: adminq", unvme_dev.vfiodev->pci);
        unvme_adminq_delete(ses->queues);
    } else {
        DEBUG_FN("%x: q=%d-%d", unvme_dev.vfiodev->pci, ses->id,
                                ses->id + ses->qcount -1);
        while (--ses->qcount >= 0) {
            unvme_queue_t* ioq = &ses->queues[ses->qcount];
            if (ioq->ses) unvme_ioq_delete(ioq);
        }
    }
    LIST_DEL(unvme_dev.ses, ses);
    free(ses);
}
开发者ID:MicronSSD,项目名称:unvme,代码行数:34,代码来源:unvme_core.c

示例3: usb_close

int
usb_close(usb_dev_handle * udev)
{
	struct usb_device *dev;
	int err;

	err = libusb20_dev_close((void *)udev);

	if (err)
		return (-1);

	if (usb_backend != NULL) {
		/*
		 * Enqueue USB device to backend queue so that it gets freed
		 * when the backend is re-scanned:
		 */
		libusb20_be_enqueue_device(usb_backend, (void *)udev);
	} else {
		/*
		 * The backend is gone. Free device data so that we
		 * don't start leaking memory!
		 */
		dev = usb_device(udev);
		libusb20_dev_free((void *)udev);
		LIST_DEL(usb_global_bus.devices, dev);
		free(dev);
	}
	return (0);
}
开发者ID:Gwenio,项目名称:DragonFlyBSD,代码行数:29,代码来源:libusb01.c

示例4: resume_listener

/* This function tries to resume a temporarily disabled listener. Paused, full,
 * limited and disabled listeners are handled, which means that this function
 * may replace enable_listener(). The resulting state will either be LI_READY
 * or LI_FULL. 0 is returned in case of failure to resume (eg: dead socket).
 */
int resume_listener(struct listener *l)
{
	if (l->state < LI_PAUSED)
		return 0;

	if (l->proto->sock_prot == IPPROTO_TCP &&
	    l->state == LI_PAUSED &&
	    listen(l->fd, l->backlog ? l->backlog : l->maxconn) != 0)
		return 0;

	if (l->state == LI_READY)
		return 1;

	if (l->state == LI_LIMITED)
		LIST_DEL(&l->wait_queue);

	if (l->nbconn >= l->maxconn) {
		l->state = LI_FULL;
		return 1;
	}

	fd_want_recv(l->fd);
	l->state = LI_READY;
	return 1;
}
开发者ID:carriercomm,项目名称:haproxy-1,代码行数:30,代码来源:listener.c

示例5: svga_buffer_upload_flush

/**
 * Patch up the upload DMA command reserved by svga_buffer_upload_command
 * with the final ranges.
 */
void
svga_buffer_upload_flush(struct svga_context *svga,
                         struct svga_buffer *sbuf)
{
   SVGA3dCopyBox *boxes;
   unsigned i;
   struct pipe_resource *dummy;

   if (!sbuf->dma.pending) {
      return;
   }

   assert(sbuf->handle);
   assert(sbuf->hwbuf);
   assert(sbuf->map.num_ranges);
   assert(sbuf->dma.svga == svga);
   assert(sbuf->dma.boxes);

   /*
    * Patch the DMA command with the final copy box.
    */

   SVGA_DBG(DEBUG_DMA, "dma to sid %p\n", sbuf->handle);

   boxes = sbuf->dma.boxes;
   for (i = 0; i < sbuf->map.num_ranges; ++i) {
      SVGA_DBG(DEBUG_DMA, "  bytes %u - %u\n",
               sbuf->map.ranges[i].start, sbuf->map.ranges[i].end);

      boxes[i].x = sbuf->map.ranges[i].start;
      boxes[i].y = 0;
      boxes[i].z = 0;
      boxes[i].w = sbuf->map.ranges[i].end - sbuf->map.ranges[i].start;
      boxes[i].h = 1;
      boxes[i].d = 1;
      boxes[i].srcx = sbuf->map.ranges[i].start;
      boxes[i].srcy = 0;
      boxes[i].srcz = 0;
   }

   sbuf->map.num_ranges = 0;

   assert(sbuf->head.prev && sbuf->head.next);
   LIST_DEL(&sbuf->head);
#ifdef DEBUG
   sbuf->head.next = sbuf->head.prev = NULL;
#endif
   sbuf->dma.pending = FALSE;
   sbuf->dma.flags.discard = FALSE;
   sbuf->dma.flags.unsynchronized = FALSE;

   sbuf->dma.svga = NULL;
   sbuf->dma.boxes = NULL;

   /* Decrement reference count (and potentially destroy) */
   dummy = &sbuf->b.b;
   pipe_resource_reference(&dummy, NULL);
}
开发者ID:ChillyWillyGuru,项目名称:RSXGL,代码行数:62,代码来源:svga_resource_buffer_upload.c

示例6: _ies_task_job_handle_queue

static _ies_task_job_handle_queue()
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    srv_ies_job             *pJob;
    SRV_IES_JOB_STATE_ENUM  state;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    pJob = NULL;

    if (LIST_EMPTY(&(g_ies_task_context.normal)))
    {
        if (!LIST_EMPTY(&(g_ies_task_context.lowest)))
        {
            pJob = (srv_ies_job*)(g_ies_task_context.lowest.pNext);
            LIST_DEL((srv_ies_list_head_struct*)pJob);
        }
    }
    else
    {
        pJob = (srv_ies_job*)(g_ies_task_context.normal.pNext);
        LIST_DEL(((srv_ies_list_head_struct*)pJob));
    }

    if (pJob)
    {
        kal_take_mutex(g_srv_ies_job_mutex);
        state = pJob->state;
        kal_give_mutex(g_srv_ies_job_mutex);

        ASSERT(SRV_IES_JOB_STATE_FINISHED != pJob->state);

        if (SRV_IES_JOB_STATE_CANCELLED != state)
        {
            g_ies_task_context.pJob = pJob;
            if (_ies_task_job_handle_start(g_ies_task_context.pJob))
            {
                g_ies_task_context.pJob = NULL;
            }
		}
    }
}
开发者ID:wangzhibinjunhua,项目名称:plutommi,代码行数:45,代码来源:ImgEdtSrvTask.c

示例7: while

static void *gp_worker_main(void *pvt)
{
    struct gp_thread *t = (struct gp_thread *)pvt;
    struct gp_query *q = NULL;
    char dummy = 0;
    int ret;

    while (!t->pool->shutdown) {

        /* ======> COND_MUTEX */
        pthread_mutex_lock(&t->cond_mutex);
        while (t->query == NULL) {
            /* wait for next query */
            pthread_cond_wait(&t->cond_wakeup, &t->cond_mutex);
            if (t->pool->shutdown) {
                pthread_exit(NULL);
            }
        }

        /* grab the query off the shared pointer */
        q = t->query;
        t->query = NULL;

        /* <====== COND_MUTEX */
        pthread_mutex_unlock(&t->cond_mutex);

        /* handle the client request */
        gp_handle_query(t->pool, q);

        /* now get lock on main queue, to play with the reply list */
        /* ======> POOL LOCK */
        pthread_mutex_lock(&t->pool->lock);

        /* put back query so that dispatcher can send reply */
        q->next = t->pool->reply_list;
        t->pool->reply_list = q;

        /* add us back to the free list but only if we are not
         * shutting down */
        if (!t->pool->shutdown) {
            LIST_DEL(t->pool->busy_list, t);
            LIST_ADD(t->pool->free_list, t);
        }

        /* <====== POOL LOCK */
        pthread_mutex_unlock(&t->pool->lock);

        /* and wake up dispatcher so it will handle it */
        ret = write(t->pool->sig_pipe[1], &dummy, 1);
        if (ret == -1) {
            GPERROR("Failed to signal dispatcher!");
        }
    }

    pthread_exit(NULL);
}
开发者ID:frozencemetery,项目名称:gssproxy,代码行数:56,代码来源:gp_workers.c

示例8: LIST_FOR_EACH

void *mm_request_bf(int n, int *steps)
{
    void *p, *prev, *next;
    void *best;
    unsigned int best_size;
    unsigned int size;
    void *new_p;
    if (steps != NULL) *steps = 0;
    if (n <= 0) return NULL;
    best = NULL;
    best_size = INT_MAX;
    LIST_FOR_EACH(FREE_LIST_HEAD, p) {
        if (steps != NULL) (*steps)++;
        size = GET_SIZE_FRONT(p);
        if (size >= (unsigned int)n) {
            best_size = size;
            best = p;
            break;
        }
    }
    if (best == NULL) return NULL;
    if (best_size >= (unsigned int)n && best_size < n + HEAD_SIZE + FOOT_SIZE + 1) { //刚好相等 或 多出来的不足以存放(head+foot+1),就把整块给用户
        LIST_DEL(best);
        SET_TAG_FRONT(best, TAG_USED);
        return GET_USER_START_FRONT(best);
    } else if (best_size >= n + HEAD_SIZE + FOOT_SIZE + 1) { //足够多,可以分成两块,一块给用户,另一块空闲
        prev = GET_PREV_FRONT(best);
        next = GET_NEXT_FRONT(best);
        SET_SIZE_FRONT(best, n);
        SET_TAG_FRONT(best, TAG_USED);
        new_p = GET_BACK_FRONT(best);
        SET_SIZE_FRONT(new_p, best_size - n - FOOT_SIZE - HEAD_SIZE);
        SET_TAG_FRONT(new_p, TAG_FREE);
        SET_NEXT_FRONT(prev, new_p);
        SET_PREV_FRONT(new_p, prev);
        SET_PREV_FRONT(next, new_p);
        SET_NEXT_FRONT(new_p, next);
        LIST_DEL(new_p);
        list_add_bf(new_p, FREE_LIST_HEAD);
        return GET_USER_START_FRONT(best);
    }
    return NULL;
}
开发者ID:innoink,项目名称:bjtu_projects,代码行数:43,代码来源:mem_mgr_bf.c

示例9: listener_full

/* Marks a ready listener as full so that the session code tries to re-enable
 * it upon next close() using resume_listener().
 */
void listener_full(struct listener *l)
{
	if (l->state >= LI_READY) {
		if (l->state == LI_LIMITED)
			LIST_DEL(&l->wait_queue);

		EV_FD_CLR(l->fd, DIR_RD);
		l->state = LI_FULL;
	}
}
开发者ID:BeachheadStudio,项目名称:haproxy,代码行数:13,代码来源:protocols.c

示例10: disable_listener

/* This function removes the specified listener's file descriptor from the
 * polling lists if it is in the LI_READY or in the LI_FULL state. The listener
 * enters LI_LISTEN.
 */
void disable_listener(struct listener *listener)
{
	if (listener->state < LI_READY)
		return;
	if (listener->state == LI_READY)
		EV_FD_CLR(listener->fd, DIR_RD);
	if (listener->state == LI_LIMITED)
		LIST_DEL(&listener->wait_queue);
	listener->state = LI_LISTEN;
}
开发者ID:BeachheadStudio,项目名称:haproxy,代码行数:14,代码来源:protocols.c

示例11: while

 ~ipcwbuf_s()
 {
     while (first_a)
     {
         ipcwspace *spc = first_a;
         LIST_DEL(spc, first_a, last_a, prev, next);
         spc->~ipcwspace();
         ph_allocator::mf(spc);
     }
 }
开发者ID:strogo,项目名称:Isotoxin,代码行数:10,代码来源:plghost.cpp

示例12: listener_full

/* Marks a ready listener as full so that the session code tries to re-enable
 * it upon next close() using resume_listener().
 */
void listener_full(struct listener *l)
{
	if (l->state >= LI_READY) {
		if (l->state == LI_LIMITED)
			LIST_DEL(&l->wait_queue);

		fd_stop_recv(l->fd);
		l->state = LI_FULL;
	}
}
开发者ID:Eyepea,项目名称:haproxy,代码行数:13,代码来源:listener.c

示例13: disable_listener

/* This function removes the specified listener's file descriptor from the
 * polling lists if it is in the LI_READY or in the LI_FULL state. The listener
 * enters LI_LISTEN.
 */
void disable_listener(struct listener *listener)
{
	if (listener->state < LI_READY)
		return;
	if (listener->state == LI_READY)
		fd_stop_recv(listener->fd);
	if (listener->state == LI_LIMITED)
		LIST_DEL(&listener->wait_queue);
	listener->state = LI_LISTEN;
}
开发者ID:Eyepea,项目名称:haproxy,代码行数:14,代码来源:listener.c

示例14: pendconn_free

/*
 * Detaches pending connection <p>, decreases the pending count, and frees
 * the pending connection. The connection might have been queued to a specific
 * server as well as to the proxy. The session also gets marked unqueued.
 */
void pendconn_free(struct pendconn *p)
{
    LIST_DEL(&p->list);
    p->sess->pend_pos = NULL;
    if (p->srv)
        p->srv->nbpend--;
    else
        p->sess->be->nbpend--;
    p->sess->be->totpend--;
    pool_free2(pool2_pendconn, p);
}
开发者ID:kjwierenga,项目名称:haproxy-icey,代码行数:16,代码来源:queue.c

示例15: req_acl_free

void
req_acl_free(struct list *r) {
	struct req_acl_rule *tr, *pr;

	list_for_each_entry_safe(pr, tr, r, list) {
		LIST_DEL(&pr->list);
		if (pr->action == PR_REQ_ACL_ACT_HTTP_AUTH)
			free(pr->http_auth.realm);

		free(pr);
	}
开发者ID:chyh1990,项目名称:fastsocket,代码行数:11,代码来源:auth.c


注:本文中的LIST_DEL函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。