]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Workaround fix for acorn mutex printing for now 17/517/1
authorjsimomaa <jani.simomaa@gmail.com>
Fri, 12 May 2017 18:49:34 +0000 (21:49 +0300)
committerjsimomaa <jani.simomaa@gmail.com>
Fri, 12 May 2017 18:49:34 +0000 (21:49 +0300)
This needs to be fixed somehow else but just a workaround for now to
prevent flooding of prints

refs #7175

Change-Id: Ia218bbfc8bd82679fb7f365c706b74c1753a1795

bundles/org.simantics.acorn/src/org/simantics/acorn/lru/LRU.java

index 80fec7032940ac3e7a6a1abbebb02325880a8bfc..690ba426f209afd52035ac875530b1f7e2b3d763 100644 (file)
@@ -556,14 +556,18 @@ public class LRU<MapKey,MapValue extends LRUObject<MapKey, MapValue>> {
                 boolean gotMutex = impl.tryAcquireMutex();
 
                 boolean done = false;
+                // TODO: fix this properly pleease
+                int count = 0;
                 while (!done) {
 
                     if (gotMutex || borrowMutex) {
                         runWithMutex();
                         done = true;
                     } else {
-                        LOGGER.warn("Retry mutex acquire");
+                        if (count % 100 == 0)
+                            LOGGER.warn("Retry mutex acquire");
                         gotMutex = impl.tryAcquireMutex();
+                        count++;
                     }
 
                 }