Index: test/cctest/test-thread-termination.cc |
diff --git a/test/cctest/test-thread-termination.cc b/test/cctest/test-thread-termination.cc |
index 4c0853955cfff25b8025fb90f5b55672e4cde5b5..619bce72c9434e3458c03d83ce41dbf025596451 100644 |
--- a/test/cctest/test-thread-termination.cc |
+++ b/test/cctest/test-thread-termination.cc |
@@ -192,73 +192,6 @@ TEST(TerminateOnlyV8ThreadFromOtherThread) { |
} |
-class LoopingThread : public v8::internal::Thread { |
- public: |
- LoopingThread() : Thread("LoopingThread") { } |
- void Run() { |
- v8::Locker locker(CcTest::default_isolate()); |
- v8::HandleScope scope(CcTest::default_isolate()); |
- v8_thread_id_ = v8::V8::GetCurrentThreadId(); |
- v8::Handle<v8::ObjectTemplate> global = |
- CreateGlobalTemplate(Signal, DoLoop); |
- v8::Handle<v8::Context> context = |
- v8::Context::New(v8::Isolate::GetCurrent(), NULL, global); |
- v8::Context::Scope context_scope(context); |
- CHECK(!v8::V8::IsExecutionTerminating()); |
- // Run a loop that will be infinite if thread termination does not work. |
- v8::Handle<v8::String> source = |
- v8::String::New("try { loop(); fail(); } catch(e) { fail(); }"); |
- v8::Script::Compile(source)->Run(); |
- } |
- |
- int GetV8ThreadId() { return v8_thread_id_; } |
- |
- private: |
- int v8_thread_id_; |
-}; |
- |
- |
-// Test that multiple threads using default isolate can be terminated |
-// from another thread when using Lockers and preemption. |
-TEST(TerminateMultipleV8ThreadsDefaultIsolate) { |
- { |
- v8::Locker locker(CcTest::default_isolate()); |
- v8::V8::Initialize(); |
- v8::Locker::StartPreemption(1); |
- semaphore = new v8::internal::Semaphore(0); |
- } |
- const int kThreads = 2; |
- i::List<LoopingThread*> threads(kThreads); |
- for (int i = 0; i < kThreads; i++) { |
- threads.Add(new LoopingThread()); |
- } |
- for (int i = 0; i < kThreads; i++) { |
- threads[i]->Start(); |
- } |
- // Wait until all threads have signaled the semaphore. |
- for (int i = 0; i < kThreads; i++) { |
- semaphore->Wait(); |
- } |
- { |
- v8::Locker locker(CcTest::default_isolate()); |
- for (int i = 0; i < kThreads; i++) { |
- v8::V8::TerminateExecution(threads[i]->GetV8ThreadId()); |
- } |
- } |
- for (int i = 0; i < kThreads; i++) { |
- threads[i]->Join(); |
- delete threads[i]; |
- } |
- { |
- v8::Locker locker(CcTest::default_isolate()); |
- v8::Locker::StopPreemption(); |
- } |
- |
- delete semaphore; |
- semaphore = NULL; |
-} |
- |
- |
int call_count = 0; |