]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Merge "Corrected lifetime of clusters from Integer.MAX_VALUE to Long.MAX_VALUE"
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 23 Nov 2017 09:39:53 +0000 (11:39 +0200)
committerGerrit Code Review <gerrit2@www.simantics.org>
Thu, 23 Nov 2017 09:39:53 +0000 (11:39 +0200)
bundles/org.simantics.acorn/src/org/simantics/acorn/MainProgram.java

index ecc9649f3b550054d0cd60220ad74a016c2d4337..b5ba2471b486b10ce91f169c2797cc0673ddc276 100644 (file)
@@ -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() {