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

Update SOS for removal of unmanaged threadpool #3303

Merged
merged 1 commit into from
Aug 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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