diff --git a/src/Compiler/Utilities/illib.fs b/src/Compiler/Utilities/illib.fs index fca3cd54605..b065018e382 100644 --- a/src/Compiler/Utilities/illib.fs +++ b/src/Compiler/Utilities/illib.fs @@ -14,7 +14,10 @@ open System.Runtime.CompilerServices [] type InterruptibleLazy<'T> private (value, valueFactory: unit -> 'T) = let syncObj = obj () + + [] let mutable valueFactory = valueFactory + let mutable value = value new(valueFactory: unit -> 'T) = InterruptibleLazy(Unchecked.defaultof<_>, valueFactory) @@ -28,7 +31,6 @@ type InterruptibleLazy<'T> private (value, valueFactory: unit -> 'T) = match box valueFactory with | null -> value | _ -> - Monitor.Enter(syncObj) try