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

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


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@xxxxxxx] 
Sent: Tuesday, August 02, 2005 5:38 AM
To: resiprocate-devel@xxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxx
https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel