|
70 | 70 | import java.util.concurrent.ConcurrentHashMap;
|
71 | 71 | import java.util.concurrent.LinkedTransferQueue;
|
72 | 72 | import java.util.concurrent.locks.ReentrantLock;
|
73 |
| -import java.util.function.BiConsumer; |
74 | 73 | import org.slf4j.Logger;
|
75 | 74 | import org.slf4j.LoggerFactory;
|
76 | 75 |
|
@@ -171,23 +170,21 @@ protected void processControlFrequencyUpdate(long previous, long current, Channe
|
171 | 170 | try
|
172 | 171 | {
|
173 | 172 | //Shutdown all existing traffic channels and clear the maps.
|
174 |
| - mAllocatedTrafficChannelMap.forEach(new BiConsumer<Long, Channel>() |
| 173 | + List<Channel> trafficChannelsToDisable = new ArrayList<>(mAllocatedTrafficChannelMap.values()); |
| 174 | + mAllocatedTrafficChannelMap.clear(); |
| 175 | + |
| 176 | + for(Channel channel : trafficChannelsToDisable) |
175 | 177 | {
|
176 |
| - @Override |
177 |
| - public void accept(Long aLong, Channel channel) |
| 178 | + if(!parentChannel.equals(channel)) |
178 | 179 | {
|
179 |
| - if(!parentChannel.equals(channel)) |
180 |
| - { |
181 |
| - broadcast(new ChannelEvent(channel, Event.REQUEST_DISABLE)); |
182 |
| - } |
| 180 | + broadcast(new ChannelEvent(channel, Event.REQUEST_DISABLE)); |
183 | 181 | }
|
184 |
| - }); |
| 182 | + } |
185 | 183 |
|
186 |
| - mAllocatedTrafficChannelMap.clear(); |
187 | 184 | mTS1ChannelGrantEventMap.clear();
|
188 | 185 | mTS2ChannelGrantEventMap.clear();
|
189 | 186 |
|
190 |
| - //Store the control channel in the allocated channel map so that we don't allocate a traffic channel against it |
| 187 | + //Store the current control channel in the allocated channel map so that we don't allocate a traffic channel against it |
191 | 188 | mAllocatedTrafficChannelMap.put(current, parentChannel);
|
192 | 189 | }
|
193 | 190 | finally
|
|
0 commit comments