summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/Core/Absy.cs4
-rw-r--r--Source/Core/AbsyQuant.cs3
-rw-r--r--Source/Core/Util.cs3
-rw-r--r--Source/VCGeneration/VC.cs2
4 files changed, 5 insertions, 7 deletions
diff --git a/Source/Core/Absy.cs b/Source/Core/Absy.cs
index 817897b7..041993a7 100644
--- a/Source/Core/Absy.cs
+++ b/Source/Core/Absy.cs
@@ -128,7 +128,7 @@ namespace Microsoft.Boogie {
public Absy(IToken tok) {
Contract.Requires(tok != null);
this._tok = tok;
- this.uniqueId = AbsyNodeCount++;
+ this.uniqueId = System.Threading.Interlocked.Increment(ref AbsyNodeCount);
}
private static int AbsyNodeCount = 0;
@@ -162,7 +162,7 @@ namespace Microsoft.Boogie {
public virtual Absy Clone() {
Contract.Ensures(Contract.Result<Absy>() != null);
Absy/*!*/ result = cce.NonNull((Absy/*!*/)this.MemberwiseClone());
- result.uniqueId = AbsyNodeCount++; // BUGBUG??
+ result.uniqueId = System.Threading.Interlocked.Increment(ref AbsyNodeCount); // BUGBUG??
if (InternalNumberedMetadata != null) {
// This should probably use the lock
diff --git a/Source/Core/AbsyQuant.cs b/Source/Core/AbsyQuant.cs
index c5b7b317..e7783943 100644
--- a/Source/Core/AbsyQuant.cs
+++ b/Source/Core/AbsyQuant.cs
@@ -624,8 +624,7 @@ namespace Microsoft.Boogie {
static int SkolemIds = 0;
public static int GetNextSkolemId() {
- SkolemIds++;
- return SkolemIds;
+ return System.Threading.Interlocked.Increment(ref SkolemIds);
}
public readonly int SkolemId;
diff --git a/Source/Core/Util.cs b/Source/Core/Util.cs
index 73008742..f8428942 100644
--- a/Source/Core/Util.cs
+++ b/Source/Core/Util.cs
@@ -676,8 +676,7 @@ namespace Microsoft.Boogie {
// any filename extension specified by the user. We base our
// calculations on that there is at most one occurrence of @PROC@.
if (180 <= fileName.Length - 6 + pn.Length) {
- pn = pn.Substring(0, Math.Max(180 - (fileName.Length - 6), 0)) + "-n" + sequenceNumber;
- sequenceNumber++;
+ pn = pn.Substring(0, Math.Max(180 - (fileName.Length - 6), 0)) + "-n" + System.Threading.Interlocked.Increment(ref sequenceNumber);
}
return fileName.Replace("@PROC@", pn);
diff --git a/Source/VCGeneration/VC.cs b/Source/VCGeneration/VC.cs
index 8a549e9d..45ce6a02 100644
--- a/Source/VCGeneration/VC.cs
+++ b/Source/VCGeneration/VC.cs
@@ -557,7 +557,7 @@ namespace VC {
this.gotoCmdOrigins = gotoCmdOrigins;
this.parent = par;
this.impl = impl;
- this.id = current_id++;
+ this.id = Interlocked.Increment(ref current_id);
}
public double Cost {