Name native threads before start (macOS/Native AOT)#114249
Name native threads before start (macOS/Native AOT)#114249jkotas merged 8 commits intodotnet:mainfrom
Conversation
There was a problem hiding this comment.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs:140
- The assignment to _startHelper._thread = this is repeated in several constructors wrapped in #if TARGET_OSX. Consider refactoring this repeated pattern into a helper method to reduce duplication and simplify maintenance.
_startHelper = new StartHelper(start);
|
Tagging subscribers to this area: @mangod9 |
1d2f58a to
3f46bf2
Compare
src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs
Outdated
Show resolved
Hide resolved
| if (!string.IsNullOrEmpty(_thread.Name)) | ||
| { | ||
| // Name the underlying native thread to match the managed thread name. | ||
| _thread.ThreadNameChanged(_thread.Name); |
There was a problem hiding this comment.
ThreadNameChanged sets the OS thread name, and also notifies profiler and debugger on CoreCLR about the thread name change. These notifications are superfluous here. I am not sure whether it matters.
src/libraries/System.Private.CoreLib/src/System/Threading/Thread.cs
Outdated
Show resolved
Hide resolved
b8ede59 to
212f47a
Compare
f069af0 to
bb816b8
Compare
38f7487 to
9efae7c
Compare
9efae7c to
18c9010
Compare
|
Since checking the native thread name is platform specific rather than cross-platform and also there were errors in some Windows legs about not finding the native methods in |
Fixes #106464.