Skip to content

Commit

Permalink
Fix sync issue in profiler tests (#46907)
Browse files Browse the repository at this point in the history
  • Loading branch information
davmason authored Jan 13, 2021
1 parent d7def35 commit fd744a8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
2 changes: 0 additions & 2 deletions src/tests/profiler/native/eltprofiler/slowpatheltprofiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,6 @@ HRESULT STDMETHODCALLTYPE SlowPathELTProfiler::LeaveCallback(FunctionIDOrClientI

HRESULT STDMETHODCALLTYPE SlowPathELTProfiler::TailcallCallback(FunctionIDOrClientID functionIdOrClientID, COR_PRF_ELT_INFO eltInfo)
{
SHUTDOWNGUARD();

COR_PRF_FRAME_INFO frameInfo;
HRESULT hr = pCorProfilerInfo->GetFunctionTailcall3Info(functionIdOrClientID.functionID, eltInfo, &frameInfo);
if (FAILED(hr))
Expand Down
32 changes: 13 additions & 19 deletions src/tests/profiler/native/profiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,19 @@ class ShutdownGuard
// Managed code can keep running after Shutdown() is called, and things like
// ELT hooks will continue to be called. We would AV if we tried to call
// in to freed resources.
#define SHUTDOWNGUARD() \
do \
{ \
ShutdownGuard(); \
if (ShutdownGuard::HasShutdownStarted()) \
{ \
return S_OK; \
} \
} while(0)

#define SHUTDOWNGUARD_RETVOID() \
do \
{ \
ShutdownGuard(); \
if (ShutdownGuard::HasShutdownStarted()) \
{ \
return; \
} \
} while(0)
#define SHUTDOWNGUARD() \
ShutdownGuard(); \
if (ShutdownGuard::HasShutdownStarted()) \
{ \
return S_OK; \
}

#define SHUTDOWNGUARD_RETVOID() \
ShutdownGuard(); \
if (ShutdownGuard::HasShutdownStarted()) \
{ \
return; \
}

class Profiler : public ICorProfilerCallback10
{
Expand Down

0 comments on commit fd744a8

Please sign in to comment.