From: Tuukka Lehtonen Date: Thu, 23 Nov 2017 09:39:53 +0000 (+0200) Subject: Merge "Corrected lifetime of clusters from Integer.MAX_VALUE to Long.MAX_VALUE" X-Git-Tag: v1.31.0~23 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=96d8636ef6a7af10b65ad0878bebeee51891790d;hp=1af831c86eead110ff4c099584f5a8480f2cf2da Merge "Corrected lifetime of clusters from Integer.MAX_VALUE to Long.MAX_VALUE" --- diff --git a/bundles/org.simantics.acorn/src/org/simantics/acorn/MainProgram.java b/bundles/org.simantics.acorn/src/org/simantics/acorn/MainProgram.java index ecc9649f3..b5ba2471b 100644 --- a/bundles/org.simantics.acorn/src/org/simantics/acorn/MainProgram.java +++ b/bundles/org.simantics.acorn/src/org/simantics/acorn/MainProgram.java @@ -300,19 +300,13 @@ public class MainProgram implements Runnable, Closeable { private void swapChunks() throws AcornAccessVerificationException, IllegalAcornStateException { // Cache chunks during update operations - boolean written = clusters.streamLRU.swap(Integer.MAX_VALUE, CHUNK_CACHE_SIZE); - while(written) { - written = clusters.streamLRU.swap(Integer.MAX_VALUE, CHUNK_CACHE_SIZE); - } + while(clusters.streamLRU.swap(Long.MAX_VALUE, CHUNK_CACHE_SIZE)); } private void swapCS() throws AcornAccessVerificationException, IllegalAcornStateException { // Cache chunks during update operations - boolean written = clusters.csLRU.swap(Integer.MAX_VALUE, CHUNK_CACHE_SIZE); - while(written) { - written = clusters.csLRU.swap(Integer.MAX_VALUE, CHUNK_CACHE_SIZE); - } + while(clusters.csLRU.swap(Long.MAX_VALUE, CHUNK_CACHE_SIZE)); } public synchronized void committed() {