We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d30685 commit 38846c3Copy full SHA for 38846c3
src/fsharp/tast.fs
@@ -35,12 +35,12 @@ open Microsoft.FSharp.Core.CompilerServices
35
/// Unique name generator for stamps attached to lambdas and object expressions
36
type Unique = int64
37
//++GLOBAL MUTABLE STATE
38
-let newUnique = let i = ref 0L in fun () -> i := !i + 1L; !i
+let newUnique = let mutable i = 0L in fun () -> System.Threading.Interlocked.Increment(&i)
39
type Stamp = int64
40
41
/// Unique name generator for stamps attached to to val_specs, tycon_specs etc.
42
43
-let newStamp = let i = ref 0L in fun () -> i := !i + 1L; !i
+let newStamp = let mutable i = 0L in fun () -> System.Threading.Interlocked.Increment(&i)
44
45
/// A global generator of compiler generated names
46
// ++GLOBAL MUTABLE STATE
0 commit comments