Skip to content

Commit

Permalink
Update Lock.xml speclet URL to published
Browse files Browse the repository at this point in the history
  • Loading branch information
richardszalay authored Oct 16, 2024
1 parent 6ddbbc5 commit 0aac76e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xml/System.Threading/Lock.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ It is recommended to use the <xref:System.Threading.Lock.EnterScope%2A> method w
:::code language="csharp" source="~/snippets/csharp/System.Threading/Lock/Overview/UsagePatterns.cs" id="Snippet1":::
When using the C# `lock` keyword or similar to enter and exit a lock, the type of the expression must be precisely `System.Threading.Lock`. If the type of the expression is anything else, such as `Object` or a generic type like `T`, a different implementation that is not interchangeable can be used instead (such as <xref:System.Threading.Monitor>). For more information, see the relevant [compiler speclet](https://github.com/dotnet/csharplang/blob/main/proposals/csharp-13.0/lock-object.md).
When using the C# `lock` keyword or similar to enter and exit a lock, the type of the expression must be precisely `System.Threading.Lock`. If the type of the expression is anything else, such as `Object` or a generic type like `T`, a different implementation that is not interchangeable can be used instead (such as <xref:System.Threading.Monitor>). For more information, see the relevant [compiler speclet](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-13.0/lock-object).
<xref:System.Threading.Thread.Interrupt%2A> can interrupt threads that are waiting to enter a lock. On Windows STA threads, waits for locks allow message pumping that can run other code on the same thread during a wait. Some features of the waits can be overridden by a custom <xref:System.Threading.SynchronizationContext>.
Expand Down

0 comments on commit 0aac76e

Please sign in to comment.