From: Jussi Koskela Date: Fri, 20 Oct 2017 06:11:13 +0000 (+0300) Subject: Declare asyncCount volatile since it is accessed from multiple threads X-Git-Tag: v1.31.0~105 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=782dfcb9fc5ce3db46598f660abf642b9c8849b7 Declare asyncCount volatile since it is accessed from multiple threads refs #7565 Change-Id: Ibea9155356882beb74e330ec8ed8b03bee3cbb15 --- diff --git a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/State.java b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/State.java index 5adc59300..f30418a6a 100644 --- a/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/State.java +++ b/bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/State.java @@ -47,7 +47,7 @@ class State { private volatile int readCount = 0; // Must be volatile so we don't have to synchronize getReadCount. private volatile int writeCount = 0; // Must be volatile so we don't have to synchronize getWriteCount. private Thread writeOwner = null; - private int asyncCount = 1; + private volatile int asyncCount = 1; // Must be volatile so we don't have to synchronize getAsyncCount. private TransactionToken transactionToken = null; void setCombine(boolean a) { if (null != transactionToken)