Author: j16sdiz
Date: 2008-09-23 10:24:09 +0000 (Tue, 23 Sep 2008)
New Revision: 22754
Modified:
trunk/freenet/src/freenet/support/SortedLongSet.java
Log:
synchronization
Modified: trunk/freenet/src/freenet/support/SortedLongSet.java
===================================================================
--- trunk/freenet/src/freenet/support/SortedLongSet.java 2008-09-23
00:25:10 UTC (rev 22753)
+++ trunk/freenet/src/freenet/support/SortedLongSet.java 2008-09-23
10:24:09 UTC (rev 22754)
@@ -158,7 +158,7 @@
/**
* Clear this set
*/
- public void clear() {
+ public synchronized void clear() {
data = new long[MIN_SIZE];
for(int i=0;i<data.length;i++)
data[i] = Long.MAX_VALUE;
@@ -170,7 +170,7 @@
*
* @return sorted array of all items
*/
- public long[] toArray() {
+ public synchronized long[] toArray() {
long[] output = new long[length];
System.arraycopy(data, 0, output, 0, length);
return output;