Changeset 93d366fe


Ignore:
Timestamp:
Aug 26, 2009 10:18:15 PM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
593d4dc
Parents:
7973f2e
Message:
  • Tunnel: Concurrentify HashSetIVValidator
File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/tunnel/HashSetIVValidator.java

    r7973f2e r93d366fe  
    11package net.i2p.router.tunnel;
    22
    3 import java.util.HashSet;
     3import java.util.Set;
    44
    55import net.i2p.data.ByteArray;
    66import net.i2p.data.DataHelper;
     7import net.i2p.util.ConcurrentHashSet;
    78
    89/**
     
    1011 */
    1112class HashSetIVValidator implements IVValidator {
    12     private final HashSet _received;
     13    private final Set<ByteArray> _received;
    1314   
    1415    public HashSetIVValidator() {
    15         _received = new HashSet();
     16        _received = new ConcurrentHashSet();
    1617    }
    1718   
     
    2223        DataHelper.xor(ivData, ivOffset, payload, payloadOffset, iv, 0, HopProcessor.IV_LENGTH);
    2324        ByteArray ba = new ByteArray(iv);
    24         boolean isNew = false;
    25         synchronized (_received) {
    26             isNew = _received.add(ba);
    27         }
     25        boolean isNew = _received.add(ba);
    2826        return isNew;
    2927    }
Note: See TracChangeset for help on using the changeset viewer.