Fix race condition in test-thread-termination.
authormstarzinger@chromium.org <mstarzinger@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 3 Apr 2012 10:15:12 +0000 (10:15 +0000)
committermstarzinger@chromium.org <mstarzinger@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 3 Apr 2012 10:15:12 +0000 (10:15 +0000)
The test case failed to stop the preemption thread before destroying the
isolate which led to a race condition where the isolate was accessed
after it had been destroyed.

R=ulan@chromium.org
BUG=v8:2049
TEST=cctest/test-thread-termination/TerminateMultipleV8ThreadsDefaultIsolate

Review URL: https://chromiumcodereview.appspot.com/9969092

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11217 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

test/cctest/test-thread-termination.cc

index 1aa57e3081a5d779addf9fe141b77edc7a9ff623..cebabaa97e84fe0076da552d5cd6bd435f14f7bc 100644 (file)
@@ -255,6 +255,10 @@ TEST(TerminateMultipleV8ThreadsDefaultIsolate) {
     threads[i]->Join();
     delete threads[i];
   }
+  {
+    v8::Locker locker;
+    v8::Locker::StopPreemption();
+  }
 
   delete semaphore;
   semaphore = NULL;