首页 > 其他 > 详细

struct 方法使用

时间:2017-07-04 19:26:13      阅读:217      评论:0      收藏:0      [点我收藏+]
struct _Worker
{
    _Worker()
    {
        pWokerbase=NULL;
        hThread=INVALID_HANDLE_VALUE;
        pListConn=NULL;
    }
    struct event_base *pWokerbase;
    HANDLE hThread;
    _ConnList *pListConn;
    inline _Conn* GetFreeConn()
    {
        _Conn*pItem=NULL;
        if(pListConn->head!=pListConn->tail)
        {
            pItem=pListConn->head;
            pListConn->head=pListConn->head->next;
        }
        return pItem;
    }
    inline void PutFreeConn(_Conn *pItem)
    {
        pListConn->tail->next=pItem;
        pListConn->tail=pItem;
    }
};

 

struct 方法使用

原文:http://www.cnblogs.com/wainiwann/p/7118052.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!