Skip to content

Commit 197e6b6

Browse files
heathsmairaw
authored andcommitted
Clarify LazyInitialize.EnsureInitialized (#3543)
Fixes #3541
1 parent c8ee7ad commit 197e6b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xml/System.Threading/LazyInitializer.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ ExpensiveData dataToUse = LazyInitializer.EnsureInitialized(ref _data, ref _data
125125
126126
This method may be used concurrently by multiple threads to initialize `target`.
127127
128-
In the event that multiple threads access this method concurrently, multiple instances of `T` may be created, but only one will be stored into `target`. In such an occurrence, this method will not dispose of the objects that were not stored. If such objects must be disposed, it is up to the caller to determine if an object was not used and to then dispose of the object appropriately.
128+
In the event that multiple threads access this method concurrently, multiple instances of `T` may be created, but only one will be stored into `target` and returned. In such an occurrence, this method will not dispose of the objects that were not stored. If such objects must be disposed, use an overload that takes a `valueFactory` and dispose of the object if it does not reference the same stored object.
129129
130130
]]></format>
131131
</remarks>

0 commit comments

Comments
 (0)