Clean up some possible thread safety issues.

This commit is contained in:
ragnarok
2005-10-21 00:10:13 +00:00
committed by zzz
parent 8458e4e0af
commit 3816c79193
2 changed files with 8 additions and 6 deletions

View File

@ -2,6 +2,7 @@ package org.klomp.snark;
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
public class Piece implements Comparable {
@ -11,7 +12,7 @@ public class Piece implements Comparable {
public Piece(int id) {
this.id = id;
this.peers = new HashSet();
this.peers = Collections.synchronizedSet(new HashSet());
this.requested = false;
}