< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

[reSIProcate] resip::AbstractFifo::getNext(int ms)


void*
AbstractFifo::getNext(int ms)
{
   const UInt64 end(Timer::getTimeMs() + ms); /// line A

   Lock lock(mMutex); (void)lock;

   // Wait until there are messages available
   while (mFifo.empty())
   {
      // bail if total wait time exceeds limit
      bool signaled = mCondition.wait(mMutex, (unsigned int)(end - 
Timer::getTimeMs()));
/// line B
      if (!signaled)
      {
        return 0;
      }
   }
...

It seems to me that there is a potential deadlock-risk if second call of 
Timer::getTimeMs()
will take place AFTER time moment "end".

--------------------------------------------------
foobar2000 v0.8.3 : (foobar2000 is not active ;-)