Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(819)

Unified Diff: runtime/vm/thread_interrupter_test.cc

Issue 1293253005: Completely remove InterruptableThreadState and Fix ThreadRegistry leak (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/thread_interrupter_macos.cc ('k') | runtime/vm/thread_interrupter_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
- 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;
« no previous file with comments | « runtime/vm/thread_interrupter_macos.cc ('k') | runtime/vm/thread_interrupter_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698