]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.procore/src/fi/vtt/simantics/procore/internal/State.java
Declare asyncCount volatile since it is accessed from multiple threads
[simantics/platform.git] / bundles / org.simantics.db.procore / src / fi / vtt / simantics / procore / internal / State.java
index 5adc593001cd19ae305c5fb3e00dfe181b0003e0..f30418a6a32869bf009fc661baa47244a4679a1b 100644 (file)
@@ -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)