CRioFreeList Class Reference

#include <riofreelist.h>

Public Member Functions

 CRioFreeList ()
 ~CRioFreeList ()
void Free (RioQueueEle *ep)
RioQueueEleGet ()
RioQueueEleGetNB ()

Private Attributes

CvsiCondition m_cond
int m_waitflag
RioQueueElem_first

Detailed Description

Definition at line 31 of file riofreelist.h.


Constructor & Destructor Documentation

CRioFreeList::CRioFreeList (  ) 

Definition at line 34 of file riofreelist.cpp.

00035 {
00036     m_waitflag = 0;
00037     m_first    = NULL;
00038 }

CRioFreeList::~CRioFreeList (  ) 

Definition at line 41 of file riofreelist.cpp.

00042 {
00043 }


Member Function Documentation

void CRioFreeList::Free ( RioQueueEle ep  ) 

Definition at line 47 of file riofreelist.cpp.

00048 {
00049     m_cond.Lock();
00050     ep->linkf = m_first;
00051     m_first = ep;
00052     if(m_waitflag)
00053     {
00054         m_cond.Signal();
00055         m_waitflag = 0;
00056     }
00057     m_cond.Unlock();
00058 }

RioQueueEle * CRioFreeList::Get ( void   ) 

Definition at line 63 of file riofreelist.cpp.

00064 {
00065     RioQueueEle *ep;
00066 
00067     m_cond.Lock();
00068     while(m_first == 0)
00069     {
00070         m_waitflag = 1;
00071         m_cond.Wait();
00072     }
00073 
00074     ep = m_first;
00075     m_first = ep->linkf;
00076 
00077     m_waitflag = 0;
00078 
00079     m_cond.Unlock();
00080 
00081     return ep;
00082 
00083 }

RioQueueEle * CRioFreeList::GetNB (  ) 

Definition at line 89 of file riofreelist.cpp.

00090 {
00091     RioQueueEle *ep;
00092 
00093     m_cond.Lock();
00094 
00095     ep = m_first;
00096 
00097     if(m_first != 0)
00098     {
00099         m_first = ep->linkf;
00100     }
00101 
00102     m_cond.Unlock();
00103 
00104     return ep;
00105 
00106 }


Field Documentation

Definition at line 43 of file riofreelist.h.

Definition at line 45 of file riofreelist.h.

int CRioFreeList::m_waitflag [private]

Definition at line 44 of file riofreelist.h.


The documentation for this class was generated from the following files:
Generated on Wed Jul 4 16:03:32 2012 for RIO by  doxygen 1.6.3