|
reSIProcate/rutil
9694
|


Public Member Functions | |
| Consumer (TimeLimitFifo< Foo > &) | |
| virtual | ~Consumer () |
| void | thread () |
Private Attributes | |
| TimeLimitFifo< Foo > & | mFifo |
Definition at line 37 of file testFifo.cxx.
| Consumer::Consumer | ( | TimeLimitFifo< Foo > & | f | ) |
Definition at line 81 of file testFifo.cxx.
: mFifo(f) {}
| virtual Consumer::~Consumer | ( | ) | [inline, virtual] |
Definition at line 41 of file testFifo.cxx.
| void Consumer::thread | ( | ) | [virtual] |
Implements resip::ThreadIf.
Definition at line 85 of file testFifo.cxx.
References resip::TimeLimitFifo< Msg >::getNext(), resip::AbstractFifo< T >::messageAvailable(), mFifo, resip::ThreadIf::mShutdown, resip::AbstractFifo< T >::size(), and sleepMS().
{
static unsigned wakeups[6] = { 10, 20, 30, 0, 10, 30 };
unsigned int w = 0;
#ifdef VERBOSE
cerr << "Consumer running..." << endl;
#endif
while (!mShutdown)
{
if (mFifo.messageAvailable())
{
delete mFifo.getNext(100);
}
else
{
unsigned wakeup = wakeups[w];
w = (w + 1) % 6;
#ifdef VERBOSE
cerr << "Consumer sleeping for " << wakeup << " ms with mSize " << mFifo.size() << endl;
#endif
if (wakeup > 0)
{
sleepMS(wakeup);
}
}
}
}

TimeLimitFifo<Foo>& Consumer::mFifo [private] |
Definition at line 56 of file testFifo.cxx.
Referenced by thread().
1.7.5.1