Skip to content

Commit 2fc073f

Browse files
authored
Fix locking in ReflectionComposablePart.ImportsCache (#103660)
The second check needs to use the value from the field (to see updates made by other threads), not the local variable. Fixes: #103650
1 parent 4a0a04c commit 2fc073f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/ReflectionComposablePart.cs

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ private Dictionary<ImportDefinition, ImportingItem> ImportsCache
8787
{
8888
lock (_lock)
8989
{
90+
value = _importsCache;
9091
if (value == null)
9192
{
9293
value = new Dictionary<ImportDefinition, ImportingItem>();

0 commit comments

Comments
 (0)