Skip to content

Commit 647475f

Browse files
Fix threading issue in TestFriendlyProjectDecompiler
1 parent 57cd68f commit 647475f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ICSharpCode.Decompiler.Tests/ProjectDecompiler/WholeProjectDecompilerTests.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,19 @@ sealed class TestFriendlyProjectDecompiler(IAssemblyResolver assemblyResolver) :
8585
protected override TextWriter CreateFile(string path)
8686
{
8787
StringWriter writer = new();
88-
Files[path] = writer;
88+
lock (Files)
89+
{
90+
Files[path] = writer;
91+
}
8992
return writer;
9093
}
9194

9295
protected override void CreateDirectory(string path)
9396
{
94-
Directories.Add(path);
97+
lock (Directories)
98+
{
99+
Directories.Add(path);
100+
}
95101
}
96102

97103
protected override IEnumerable<ProjectItemInfo> WriteMiscellaneousFilesInProject(PEFile module) => [];

0 commit comments

Comments
 (0)