-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Update Thread.Abort docs #8110
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 Thread.Abort docs #8110
Conversation
> [!IMPORTANT] | ||
> The `Thread.Abort` method should be used with caution. Particularly when you call it to abort a thread other than the current thread, you don't know what code has executed or failed to execute when the <xref:System.Threading.ThreadAbortException> is thrown. You also cannot be certain of the state of your application or any application and user state that it's responsible for preserving. For example, calling `Thread.Abort` may prevent the execution of static constructors or the release of unmanaged resources. | ||
> Use the `Thread.Abort` method with caution. Particularly when you call it to abort a thread other than the current thread, you don't know what code has executed or failed to execute when the <xref:System.Threading.ThreadAbortException> is thrown. You also cannot be certain of the state of your application or any application and user state that it's responsible for preserving. For example, calling `Thread.Abort` may prevent the execution of static constructors or the release of managed or unmanaged resources. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or the release of managed or unmanaged resources
Managed resources would be released at some point, I think the main issue is with unmanaged resources.
Docs Build status updates of commit b64c4fb: ✅ Validation status: passed
For more details, please refer to the build report. Note: Broken links written as relative paths are included in the above build report. For broken links written as absolute paths or external URLs, see the broken link report. For any questions, please:
|
> [!IMPORTANT] | ||
> The `Thread.Abort` method should be used with caution. Particularly when you call it to abort a thread other than the current thread, you don't know what code has executed or failed to execute when the <xref:System.Threading.ThreadAbortException> is thrown. You also cannot be certain of the state of your application or any application and user state that it's responsible for preserving. For example, calling `Thread.Abort` may prevent the execution of static constructors or the release of unmanaged resources. | ||
> Use the `Thread.Abort` method with caution. Particularly when you call it to abort a thread other than the current thread, you don't know what code has executed or failed to execute when the <xref:System.Threading.ThreadAbortException> is thrown. You also cannot be certain of the state of your application or any application and user state that it's responsible for preserving. For example, calling `Thread.Abort` may prevent the execution of static constructors or the release of managed or unmanaged resources. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
> Use the `Thread.Abort` method with caution. Particularly when you call it to abort a thread other than the current thread, you don't know what code has executed or failed to execute when the <xref:System.Threading.ThreadAbortException> is thrown. You also cannot be certain of the state of your application or any application and user state that it's responsible for preserving. For example, calling `Thread.Abort` may prevent the execution of static constructors or the release of managed or unmanaged resources. | |
> Use the `Thread.Abort` method with caution. Particularly when you call it to abort a thread other than the current thread, you don't know what code has executed or failed to execute when the <xref:System.Threading.ThreadAbortException> is thrown. You also cannot be certain of the state of your application or any application and user state that it's responsible for preserving. For example, calling `Thread.Abort` may prevent the execution of static constructors or the release of unmanaged resources. It can even corrupt managed data structures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kouvel I updated it based on dotnet/docs#29624 (comment). Does this look okay to you?
Follow up to dotnet/docs#29624.