mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 09:07:27 -05:00
#1998 P25 Traffic Channel Manager error ConcurrentModification on Allocated Channels Map, introduced in #1996
This commit is contained in:
@@ -70,7 +70,6 @@ import java.util.Queue;
|
|||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.LinkedTransferQueue;
|
import java.util.concurrent.LinkedTransferQueue;
|
||||||
import java.util.concurrent.locks.ReentrantLock;
|
import java.util.concurrent.locks.ReentrantLock;
|
||||||
import java.util.function.BiConsumer;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -171,23 +170,21 @@ public class P25TrafficChannelManager extends TrafficChannelManager implements I
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
//Shutdown all existing traffic channels and clear the maps.
|
//Shutdown all existing traffic channels and clear the maps.
|
||||||
mAllocatedTrafficChannelMap.forEach(new BiConsumer<Long, Channel>()
|
List<Channel> trafficChannelsToDisable = new ArrayList<>(mAllocatedTrafficChannelMap.values());
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void accept(Long aLong, Channel channel)
|
|
||||||
{
|
|
||||||
if(!parentChannel.equals(channel))
|
|
||||||
{
|
|
||||||
broadcast(new ChannelEvent(channel, Event.REQUEST_DISABLE));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
mAllocatedTrafficChannelMap.clear();
|
mAllocatedTrafficChannelMap.clear();
|
||||||
|
|
||||||
|
for(Channel channel : trafficChannelsToDisable)
|
||||||
|
{
|
||||||
|
if(!parentChannel.equals(channel))
|
||||||
|
{
|
||||||
|
broadcast(new ChannelEvent(channel, Event.REQUEST_DISABLE));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
mTS1ChannelGrantEventMap.clear();
|
mTS1ChannelGrantEventMap.clear();
|
||||||
mTS2ChannelGrantEventMap.clear();
|
mTS2ChannelGrantEventMap.clear();
|
||||||
|
|
||||||
//Store the control channel in the allocated channel map so that we don't allocate a traffic channel against it
|
//Store the current control channel in the allocated channel map so that we don't allocate a traffic channel against it
|
||||||
mAllocatedTrafficChannelMap.put(current, parentChannel);
|
mAllocatedTrafficChannelMap.put(current, parentChannel);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
Reference in New Issue
Block a user