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

Misc cleanup of VM threading code #108171

Merged
merged 1 commit into from
Sep 24, 2024
Merged

Misc cleanup of VM threading code #108171

merged 1 commit into from
Sep 24, 2024

Conversation

jkotas
Copy link
Member

@jkotas jkotas commented Sep 24, 2024

  • Delete special-casing of thread finalizer
  • Factor out Get/SetApartment of unstarted threads
  • Delete some dead code
  • Fix comments

- Delete special-casing of thread finalizer
- Factor out Get/SetApartment of unstarted threads
- Delete some dead code
- Fix comments
Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

{
_mayNeedResetForThreadPool = true;
}
_mayNeedResetForThreadPool = true;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not handling the case of finalizer threads.

@@ -14,9 +14,6 @@ namespace System.Threading
{
public sealed partial class Thread
{
[ThreadStatic]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code

LOG((LF_GC, LL_INFO10, "Finalizer thread starting...\n"));

#if defined(FEATURE_COMINTEROP_APARTMENT_SUPPORT) && !defined(FEATURE_COMINTEROP)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition was always false.

@@ -4799,6 +4770,9 @@ Thread::ApartmentState Thread::SetApartment(ApartmentState state)
}
CONTRACTL_END;

// This method can be called on current thread only
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the non-current thread callers to use SetApartmentOfUnstartedThread

@jkotas
Copy link
Member Author

jkotas commented Sep 24, 2024

Motivated by HMF->QCall conversion codereviews

@jkotas
Copy link
Member Author

jkotas commented Sep 24, 2024

/azp run runtime-coreclr outerloop

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JulieLeeMSFT
Copy link
Member

@jkotas, all test legs failed in runtime-coreclr libraries-jitstress/20240924.1. PTAL.

@jkotas jkotas deleted the ApartmentState branch September 24, 2024 17:57
@jkotas
Copy link
Member Author

jkotas commented Sep 24, 2024

Similar set of failures was hit in https://dev.azure.com/dnceng-public/public/_build/results?buildId=815402&view=ms.vss-test-web.build-test-results-tab that did not include this change.

@jkotas
Copy link
Member Author

jkotas commented Sep 27, 2024

These failures should be fixed by #108169

sirntar pushed a commit to sirntar/runtime that referenced this pull request Sep 30, 2024
- Delete special-casing of thread finalizer
- Factor out Get/SetApartment of unstarted threads
- Delete some dead code
- Fix comments
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants