mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 06:12:05 +01:00
Small fixes.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1803 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
25628bd0e9
commit
f6b61b5715
1 changed files with 6 additions and 5 deletions
|
@ -64,7 +64,7 @@ import java.util.LinkedList;
|
|||
* use than a {@link PacketListener} when you need to wait for a specific
|
||||
* result.
|
||||
*
|
||||
* @see PacketReader#createPacketCollector(PacketFilter)
|
||||
* @see XMPPConnection#createPacketCollector(PacketFilter)
|
||||
* @author Matt Tucker
|
||||
*/
|
||||
public class PacketCollector {
|
||||
|
@ -85,8 +85,7 @@ public class PacketCollector {
|
|||
this.packetReader = packetReader;
|
||||
this.packetFilter = packetFilter;
|
||||
this.resultQueue = new LinkedList();
|
||||
|
||||
// Add the collector to the packet reader's list of active collector.
|
||||
// Add the collector to the packet reader's list of active collector.
|
||||
synchronized (packetReader.collectors) {
|
||||
packetReader.collectors.add(this);
|
||||
}
|
||||
|
@ -107,8 +106,10 @@ public class PacketCollector {
|
|||
// Remove object from collectors list by setting the value in the
|
||||
// list at the correct index to null. The collector thread will
|
||||
// automatically remove the actual list entry when it can.
|
||||
int index = packetReader.collectors.indexOf(this);
|
||||
packetReader.collectors.set(index, null);
|
||||
synchronized (packetReader.collectors) {
|
||||
int index = packetReader.collectors.indexOf(this);
|
||||
packetReader.collectors.set(index, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue