From 0a3ab7da1bb5dc6117a99a52b7605f196220bce5 Mon Sep 17 00:00:00 2001 From: orbiter Date: Fri, 12 Aug 2011 08:06:21 +0000 Subject: [PATCH] do not sort concrrently the same array git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7868 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/net/yacy/kelondro/index/RowCollection.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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, Iterable, 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 {