Index: base/profiler/stack_sampling_profiler_unittest.cc |
diff --git a/base/profiler/stack_sampling_profiler_unittest.cc b/base/profiler/stack_sampling_profiler_unittest.cc |
index dfccab4e1a893ae7da9c768f0e5c17aef4f9b692..ad9e92655719b6271fda394ba2fcb42711b32bbf 100644 |
--- a/base/profiler/stack_sampling_profiler_unittest.cc |
+++ b/base/profiler/stack_sampling_profiler_unittest.cc |
@@ -70,19 +70,16 @@ void TargetThread::SignalThreadToFinish() { |
} |
// static |
-#if defined(_WIN64) |
-// Disable optimizations for this function so that it gets its own stack frame. |
-#pragma optimize("", off) |
-#endif |
-void TargetThread::SignalAndWaitUntilSignaled( |
+// Disable inlining for this function so that it gets its own stack frame. |
+NOINLINE void TargetThread::SignalAndWaitUntilSignaled( |
WaitableEvent* thread_started_event, |
WaitableEvent* finish_event) { |
thread_started_event->Signal(); |
+ volatile int x = 1; |
finish_event->Wait(); |
+ x = 0; // Prevent tail call to WaitableEvent::Wait(). |
+ ALLOW_UNUSED_LOCAL(x); |
} |
-#if defined(_WIN64) |
-#pragma optimize("", on) |
-#endif |
// Called on the profiler thread when complete. Collects profiles produced by |
// the profiler, and signals an event to allow the main thread to know that that |