Use FLS detach callback as a thread termination notification. Another try. by VSadov · Pull Request #112809 · dotnet/runtime

AI review requested due to automatic review settings

February 22, 2025 01:55

This was referenced

Feb 22, 2025

jkotas

jkotas

jkotas

VSadov

jkotas

@VSadov

@VSadov

@VSadov

Co-authored-by: Jan Kotas <jkotas@microsoft.com>

@VSadov

@VSadov

@VSadov

Co-authored-by: Jan Kotas <jkotas@microsoft.com>

@VSadov

@VSadov

@VSadov

@VSadov

VSadov added a commit to VSadov/runtime that referenced this pull request

Mar 3, 2025
… try. (dotnet#112809)

* Use FLS detach as thread termination notification on windows.

* use _ASSERTE_ALL_BUILDS

* one more case

* InitFlsSlot throws per convention used in threading initialization

* OsDetachThread could be void

* Update src/coreclr/vm/ceemain.cpp

* ensure CoInitialize

* Asserts to fail deterministically.

* comments

* scope the failfast to Windows and tweak the comments a bit.

* better assert

* Apply suggestions from code review

Co-authored-by: Jan Kotas <jkotas@microsoft.com>

* Undo unnecessary finalizer thread changes

* reverse the failfast condition

* handle destruction of unattached threads

* PR feedback

Co-authored-by: Jan Kotas <jkotas@microsoft.com>

* Update src/coreclr/vm/ceemain.cpp

* set g_fComStarted as soon as we call CoInitialize

* Naming nit

* fix a typpo + better comment

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>

VSadov added a commit that referenced this pull request

Mar 19, 2025
… try. (#112809) (#113055)

* Use FLS detach as thread termination notification on windows.

* use _ASSERTE_ALL_BUILDS

* one more case

* InitFlsSlot throws per convention used in threading initialization

* OsDetachThread could be void

* Update src/coreclr/vm/ceemain.cpp

* ensure CoInitialize

* Asserts to fail deterministically.

* comments

* scope the failfast to Windows and tweak the comments a bit.

* better assert

* Apply suggestions from code review



* Undo unnecessary finalizer thread changes

* reverse the failfast condition

* handle destruction of unattached threads

* PR feedback



* Update src/coreclr/vm/ceemain.cpp

* set g_fComStarted as soon as we call CoInitialize

* Naming nit

* fix a typpo + better comment

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>