Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/release-notes/.FSharp.Compiler.Service/9.0.200.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### Fixed

* Ensure `frameworkTcImportsCache` mutations are threadsafe. ([PR #17795](https://github.com/dotnet/fsharp/pull/17795))

### Added

Expand Down
6 changes: 4 additions & 2 deletions src/Compiler/Service/IncrementalBuild.fs
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,12 @@ type FrameworkImportsCache(size) =
let frameworkTcImportsCache = AgedLookup<AnyCallerThreadToken, FrameworkImportsCacheKey, GraphNode<TcGlobals * TcImports>>(size, areSimilar=(fun (x, y) -> x = y))

/// Reduce the size of the cache in low-memory scenarios
member _.Downsize() = frameworkTcImportsCache.Resize(AnyCallerThread, newKeepStrongly=0)
member _.Downsize() = lock gate <| fun () ->
frameworkTcImportsCache.Resize(AnyCallerThread, newKeepStrongly=0)

/// Clear the cache
member _.Clear() = frameworkTcImportsCache.Clear AnyCallerThread
member _.Clear() = lock gate <| fun () ->
frameworkTcImportsCache.Clear AnyCallerThread

/// This function strips the "System" assemblies from the tcConfig and returns a age-cached TcImports for them.
member _.GetNode(tcConfig: TcConfig, frameworkDLLs: AssemblyResolution list, nonFrameworkResolutions: AssemblyResolution list) =
Expand Down
Loading