#1353 Resolves issue where polyphase channelizer would mis-tune channels after a period of time resulting in idle decoding channels. (#1354)

Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
Denny Sheirer
2022-12-17 03:54:50 -05:00
committed by GitHub
parent efe36b0682
commit bf935555bb
10 changed files with 438 additions and 268 deletions

View File

@@ -156,40 +156,47 @@ public class Dispatcher<E> implements Listener<E>
@Override
public void run()
{
mQueue.clear();
E element;
while(mRunning.get())
try
{
try
{
element = mQueue.take();
mQueue.clear();
if(mPoisonPill == element)
E element;
while(mRunning.get())
{
try
{
mRunning.set(false);
}
else if(element != null)
{
if(mListener == null)
element = mQueue.take();
if(mPoisonPill == element)
{
throw new IllegalStateException("Listener for [" + mThreadName + "] is null");
mRunning.set(false);
}
mListener.receive(element);
else if(element != null)
{
if(mListener == null)
{
throw new IllegalStateException("Listener for [" + mThreadName + "] is null");
}
mListener.receive(element);
}
}
catch(InterruptedException e)
{
mLog.error("Buffer processor thread was interrupted");
}
catch(Exception e)
{
mLog.error("Error while processing element", e);
}
}
catch(InterruptedException e)
{
mLog.error("Buffer processor thread was interrupted");
}
catch(Exception e)
{
mLog.error("Error while processing element", e);
}
}
mQueue.clear();
mQueue.clear();
}
catch(Throwable t)
{
mLog.error("Unexpected error thrown from the Dispatcher thread", t);
}
}
}
}