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

RE: [reSIProcate] maybe have a bug in Condition::wait()


What version are you using?  This bug has already been fixed in the SVN head.  The if – should really be a while loop.

 


From: resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx [mailto:resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Noiile
Sent: Tuesday, October 18, 2005 7:15 AM
To: resiprocate-devel
Subject: [reSIProcate] maybe have a bug in Condition::wait()

 

resiprocate-devel, Hello

 

In my win32 project, I used DumThread, AbstractFifo::getNext(int ms) will be called in DumThread.

When I run my program, Sometimes it will prompt me "Assertion failed: mSize!=0, file AbstractFifo.cxx, line 57". I think maybe have some problems in function Condition.wait(), because it returns true but mFifo is empty.

So I changed some codes as follows, and it runs well.

 

In function:

AbstractFifo::getNext(int ms)

{

    ....

   if (mFifo.empty())
   {
      bool signaled = mCondition.wait(mMutex, ms);
      if (!signaled || mFifo.empty())             //Changed by NOIILE;
      {
        return 0;
      }
   }
   

    ....

}

 

 

 

2005-10-18