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

Scott Godin slgodin at icescape.com
Tue Aug 9 14:07:35 CDT 2005


Hi Stensil,

Yes, I think you are right.  I've committed a fix for this to the SVN
head.  Thanks!

Scott

-----Original Message-----
From: stensil [mailto:stensil at list.ru] 
Sent: Tuesday, August 02, 2005 5:38 AM
To: resiprocate-devel at list.sipfoundry.org
Subject: [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 ;-)

_______________________________________________
resiprocate-devel mailing list
resiprocate-devel at list.sipfoundry.org
https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel



More information about the resiprocate-devel mailing list