Chromium Code Reviews| Index: runtime/vm/thread_interrupter_test.cc |
| diff --git a/runtime/vm/thread_interrupter_test.cc b/runtime/vm/thread_interrupter_test.cc |
| index 4d69edd49d3c4be523df0a96e3851276107b0592..aeb9ff188f8d7c79bc106dc5d2430cc6def59247 100644 |
| --- a/runtime/vm/thread_interrupter_test.cc |
| +++ b/runtime/vm/thread_interrupter_test.cc |
| @@ -17,11 +17,12 @@ class ThreadInterrupterTestHelper : public AllStatic { |
| static void InterruptTest(const intptr_t run_time, const intptr_t period) { |
| const double allowed_error = 0.25; // +/- 25% |
| intptr_t count = 0; |
| - ThreadInterrupter::Unregister(); |
| + Thread::EnsureInit(); |
| + Thread* thread = Thread::Current(); |
| + thread->SetThreadInterrupter(IncrementCallback, &count); |
| ThreadInterrupter::SetInterruptPeriod(period); |
| - ThreadInterrupter::Register(IncrementCallback, &count); |
| OS::Sleep(run_time * kMillisecondsPerSecond); |
|
Ivan Posva
2015/08/20 18:00:10
Different CL: If the thread is sleeping we should
Cutch
2015/08/20 20:40:19
Acknowledged.
|
| - ThreadInterrupter::Unregister(); |
| + thread->SetThreadInterrupter(NULL, NULL); |
| intptr_t run_time_micros = run_time * kMicrosecondsPerSecond; |
| intptr_t expected_interrupts = run_time_micros / period; |
| intptr_t error = allowed_error * expected_interrupts; |