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;
    }
};

 

posted on 2017-07-04 18:41  瓦楞球  阅读(451)  评论(0编辑  收藏  举报