Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ThreadLocal`1.xml #9815

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 6 additions & 4 deletions xml/System.Threading/ThreadLocal`1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -623,15 +623,17 @@
<value>Returns an instance of the object that this ThreadLocal is responsible for initializing.</value>
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks
If this instance was not previously initialized for the current thread, accessing <xref:System.Threading.ThreadLocal%601.Value%2A> will attempt to initialize it. If an initialization function was supplied during the construction, that initialization will happen by invoking the function to retrieve the initial value for <xref:System.Threading.ThreadLocal%601.Value%2A>. Otherwise, the default value of `T` will be used.

If this instance was not previously initialized for the current thread, accessing <xref:System.Threading.ThreadLocal%601.Value%2A> will initialize it.
If a value factory was supplied during the construction, initialization will happen by invoking the function to retrieve the initial value for <xref:System.Threading.ThreadLocal%601.Value%2A>.
Otherwise, the default value of `T` will be used.
Regardless of the initialization method, <xref:System.Threading.ThreadLocal%601.IsValueCreated%2A> will be set to `true`.

]]></format>
</remarks>
<exception cref="T:System.ObjectDisposedException">The <see cref="T:System.Threading.ThreadLocal`1" /> instance has been disposed.</exception>
<exception cref="T:System.InvalidOperationException">The initialization function attempted to reference <see cref="P:System.Threading.ThreadLocal`1.Value" /> recursively.</exception>
<exception cref="T:System.MissingMemberException">No parameterless constructor is provided and no value factory is supplied.</exception>
<altmember cref="T:System.Lazy`1" />
<related type="Article" href="/dotnet/framework/performance/lazy-initialization">Lazy Initialization</related>
<related type="Article" href="/dotnet/framework/performance/how-to-perform-lazy-initialization-of-objects">How to: Perform Lazy Initialization of Objects</related>
Expand Down