Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

do not sort concrrently the same array

orbiter0a3ab7da1bb5
diff --git a/source/net/yacy/kelondro/index/RowCollection.java b/source/net/yacy/kelondro/index/RowCollection.java
index bd467f2b8..f0ae59e56 100644
--- a/source/net/yacy/kelondro/index/RowCollection.java
+++ b/source/net/yacy/kelondro/index/RowCollection.java
@@ -616,8 +616,11 @@ public class RowCollection implements Sortable<Row.Entry>, Iterable<Row.Entry>,
public final void sort() {
if (this.sortBound == this.chunkcount) return; // this is sorted
- net.yacy.cora.storage.Array.sort(this);
- this.sortBound = this.chunkcount;
+ synchronized (this) {
+ if (this.sortBound == this.chunkcount) return; // check again
+ net.yacy.cora.storage.Array.sort(this);
+ this.sortBound = this.chunkcount;
+ }
}
public static class partitionthread implements Callable<Integer> {