Skip to content

Commit

Permalink
Update SOS for removal of unmanaged threadpool (#3303)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotas committed Aug 21, 2022
1 parent 8693ad5 commit ad16639
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/SOS/Strike/strike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8009,6 +8009,7 @@ DECLARE_API(ThreadPool)
MINIDUMP_NOT_SUPPORTED();

BOOL doHCDump = FALSE, doWorkItemDump = FALSE, dml = FALSE;
BOOL mustBePortableThreadPool = FALSE;

CMDOption option[] =
{ // name, vptr, type, hasValue
Expand All @@ -8025,7 +8026,12 @@ DECLARE_API(ThreadPool)
EnableDMLHolder dmlHolder(dml);

DacpThreadpoolData threadpool;
if ((Status = threadpool.Request(g_sos)) != S_OK)
Status = threadpool.Request(g_sos);
if (Status == E_NOTIMPL)
{
mustBePortableThreadPool = TRUE;
}
else if (Status != S_OK)
{
ExtOut(" %s\n", "Failed to request ThreadpoolMgr information");
return FAILED(Status) ? Status : E_FAIL;
Expand Down Expand Up @@ -8055,19 +8061,22 @@ DECLARE_API(ThreadPool)
int portableTpHcLogEntry_lastHistoryMeanOffset = 0;
do // while (false)
{
// Determine if the portable thread pool is enabled
if (FAILED(
if (!mustBePortableThreadPool)
{
// Determine if the portable thread pool is enabled
if (FAILED(
GetNonSharedStaticFieldValueFromName(
&ui64Value,
corelibModule,
"System.Threading.ThreadPool",
W("UsePortableThreadPool"),
ELEMENT_TYPE_BOOLEAN)) ||
ui64Value == 0)
{
// The type was not loaded yet, or the static field was not found, etc. For now assume that the portable thread pool
// is not being used.
break;
ui64Value == 0)
{
// The type was not loaded yet, or the static field was not found, etc. For now assume that the portable thread pool
// is not being used.
break;
}
}

// Get the thread pool instance
Expand Down

0 comments on commit ad16639

Please sign in to comment.