diff --git a/bin/microprofile-win32-cswitch_x64.exe b/bin/microprofile-win32-cswitch_x64.exe index c3c522c..332fdf2 100644 Binary files a/bin/microprofile-win32-cswitch_x64.exe and b/bin/microprofile-win32-cswitch_x64.exe differ diff --git a/bin/microprofile-win32-cswitch_x64.pdb b/bin/microprofile-win32-cswitch_x64.pdb index 8ff64d5..951bce8 100644 Binary files a/bin/microprofile-win32-cswitch_x64.pdb and b/bin/microprofile-win32-cswitch_x64.pdb differ diff --git a/bin/microprofile-win32-cswitch_x86.exe b/bin/microprofile-win32-cswitch_x86.exe index 3f5097a..fe54581 100644 Binary files a/bin/microprofile-win32-cswitch_x86.exe and b/bin/microprofile-win32-cswitch_x86.exe differ diff --git a/bin/microprofile-win32-cswitch_x86.pdb b/bin/microprofile-win32-cswitch_x86.pdb index 525831a..f0622ac 100644 Binary files a/bin/microprofile-win32-cswitch_x86.pdb and b/bin/microprofile-win32-cswitch_x86.pdb differ diff --git a/microprofile.cpp b/microprofile.cpp index a6605a9..a094821 100644 --- a/microprofile.cpp +++ b/microprofile.cpp @@ -7721,6 +7721,10 @@ int main(int argc, char* argv[]) if (g_pShared != NULL) { + while (g_pShared->nTickProgram.load(std::memory_order_acquire) == 0 || g_pShared->nTickTrace.load(std::memory_order_acquire) == 0) { + Sleep(20); + } + MicroProfileStartWin32Trace(MicroProfileContextSwitchCallbackCollector, MicroProfileBufferCallbackCollector); UnmapViewOfFile(g_pShared); } @@ -7754,9 +7758,9 @@ void* MicroProfileTraceThread(void* unused) #else #define CSWITCH_EXE "microprofile-win32-cswitch_x64.exe" #endif + HINSTANCE Instance = ShellExecuteA(NULL, "runas", CSWITCH_EXE, Filename, "", SW_SHOWMINNOACTIVE); pShared->nTickProgram.store(MP_TICK()); pShared->nTickTrace.store(MP_TICK()); - HINSTANCE Instance = ShellExecuteA(NULL, "runas", CSWITCH_EXE, Filename, "", SW_SHOWMINNOACTIVE); int64_t nInstance = (int64_t)Instance; if(nInstance >= 32) {