We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8b51fa7 commit f4bd54cCopy full SHA for f4bd54c
src/Compiler/Utilities/illib.fs
@@ -14,7 +14,10 @@ open System.Runtime.CompilerServices
14
[<Class>]
15
type InterruptibleLazy<'T> private (value, valueFactory: unit -> 'T) =
16
let syncObj = obj ()
17
+
18
+ [<VolatileField>]
19
let mutable valueFactory = valueFactory
20
21
let mutable value = value
22
23
new(valueFactory: unit -> 'T) = InterruptibleLazy(Unchecked.defaultof<_>, valueFactory)
@@ -28,7 +31,6 @@ type InterruptibleLazy<'T> private (value, valueFactory: unit -> 'T) =
28
31
match box valueFactory with
29
32
| null -> value
30
33
| _ ->
-
34
Monitor.Enter(syncObj)
35
36
try
0 commit comments