File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -736,17 +736,18 @@ public string ThreadName
736
736
m_data . ThreadName =
737
737
SystemInfo . CurrentThreadId . ToString ( System . Globalization . NumberFormatInfo . InvariantInfo ) ;
738
738
#else
739
- // '.NET ThreadPool Worker' appears as a default thread pool name in .NET 6+.
739
+ // '.NET ThreadPool Worker' appears as a default thread name in the .NET 6-7 thread pool.
740
+ // '.NET TP Worker' is the default thread name in the .NET 8+ thread pool.
740
741
// Prefer the numeric thread ID instead.
741
742
string threadName = System . Threading . Thread . CurrentThread . Name ;
742
- if ( ! string . IsNullOrEmpty ( threadName ) && threadName != ".NET ThreadPool Worker" )
743
+ if ( ! string . IsNullOrEmpty ( threadName ) && threadName != ".NET ThreadPool Worker" && threadName != ".NET TP Worker" )
743
744
{
744
745
m_data . ThreadName = threadName ;
745
746
}
746
747
else
747
748
{
748
749
// The thread name is not available or unsuitable. Therefore we
749
- // go the the AppDomain to get the ID of the
750
+ // go to the AppDomain to get the ID of the
750
751
// current thread. (Why don't Threads know their own ID?)
751
752
try
752
753
{
You can’t perform that action at this time.
0 commit comments