[Live-devel] DelayQueue infinite loop

Ross Finlayson finlayson at live555.com
Tue Aug 26 14:22:31 PDT 2014


> DelayQueue::synchronize appears to be stuck in that while loop. It appears curEntry->fDeltatTimeRemaning is always (0,0)

No, that shouldn't happen.  See below.


> This is in DelayQueue.cpp at DelayQueue::synchronize
> Loop starts at line 214.
> 
> 
> DelayQueueEntry* curEntry = head();
> 
> while (timeSinceLastSync >= curEntry->fDeltaTimeRemaining) {
> 
> timeSinceLastSync -= curEntry->fDeltaTimeRemaining;
> 
> curEntry->fDeltaTimeRemaining = DELAY_ZERO;
> 
> curEntry = curEntry->fNext;
> 
> }

Note that "curEntry" is set to the next entry in the queue, before continuing the loop.  Also, each delay queue is set up so that the last entry in the queue has a delay ("fDeltaTimeRemaining") of 'eternity' (in reality, 68 years).  So the condition "timeSinceLastSync >= curEntry->fDeltaTimeRemaining" is never true for the last entry in the queue, and so the "while()" loop will always terminate.

So, something else must be wrong in your system.  (I hope you don't have more than one thread trying to use the same UsageEnvironment & TashScheduler?)


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20140826/b9ed22bc/attachment-0001.html>


More information about the live-devel mailing list