加上锁

This commit is contained in:
zhangxin10 2015-11-14 15:26:16 +08:00
parent 64f672ec37
commit bd495ab07e
1 changed files with 8 additions and 4 deletions

View File

@ -97,12 +97,16 @@ public class DataSenderFactory {
break;
}
try {
availableSenders.add(new DataSender(tmpScoketAddress));
unUsedSocketAddresses.remove(tmpScoketAddress);
} catch (IOException e) {
synchronized (lock) {
try {
availableSenders.add(new DataSender(tmpScoketAddress));
unUsedSocketAddresses.remove(tmpScoketAddress);
} catch (IOException e) {
}
}
}
try {