We need to synchronize some toString methods since they access some data structures that cannot be modified concurrently

This commit is contained in:
Joshua Kissoon 2014-05-05 15:47:07 +05:30
parent d920f2621e
commit 8d3ceb3ae1
3 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ public class DefaultConfiguration implements KadConfiguration
private final static long RESPONSE_TIMEOUT = 1500;
private final static long OPERATION_TIMEOUT = 3000;
private final static int CONCURRENCY = 10;
private final static int K = 4;
private final static int K = 10;
private final static int RCSIZE = 3;
private final static int STALE = 1;
private final static String LOCAL_FOLDER = "kademlia";

View File

@ -319,7 +319,7 @@ public class DHT
}
@Override
public String toString()
public synchronized String toString()
{
return this.entriesManager.toString();
}

View File

@ -176,7 +176,7 @@ class StoredContentManager
}
@Override
public String toString()
public synchronized String toString()
{
StringBuilder sb = new StringBuilder("Stored Content: \n");
for (List<StorageEntryMetadata> es : this.entries.values())