Revision: 8256
Author:   [email protected]
Date:     Fri Jun 10 02:36:35 2011
Log:      trying to fix test
http://code.google.com/p/v8/source/detail?r=8256

Modified:
 /branches/bleeding_edge/include/v8.h
 /branches/bleeding_edge/src/api.cc
 /branches/bleeding_edge/test/cctest/test-thread-termination.cc

=======================================
--- /branches/bleeding_edge/include/v8.h        Thu Jun  9 03:03:35 2011
+++ /branches/bleeding_edge/include/v8.h        Fri Jun 10 02:36:35 2011
@@ -3099,7 +3099,7 @@
    * still JavaScript frames on the stack and the termination
    * exception is still active.
    */
-  static bool IsExecutionTerminating();
+  static bool IsExecutionTerminating(Isolate* isolate = NULL);

   /**
    * Releases any resources used by v8 and stops any utility threads
=======================================
--- /branches/bleeding_edge/src/api.cc  Tue Jun  7 08:01:52 2011
+++ /branches/bleeding_edge/src/api.cc  Fri Jun 10 02:36:35 2011
@@ -4902,9 +4902,10 @@
 }


-bool V8::IsExecutionTerminating() {
-  i::Isolate* isolate = i::Isolate::Current();
-  return IsExecutionTerminatingCheck(isolate);
+bool V8::IsExecutionTerminating(Isolate* isolate) {
+  i::Isolate* i_isolate = isolate != NULL ?
+      reinterpret_cast<i::Isolate*>(isolate) : i::Isolate::Current();
+  return IsExecutionTerminatingCheck(i_isolate);
 }


=======================================
--- /branches/bleeding_edge/test/cctest/test-thread-termination.cc Fri Jun 10 02:36:18 2011 +++ /branches/bleeding_edge/test/cctest/test-thread-termination.cc Fri Jun 10 02:36:35 2011
@@ -160,12 +160,17 @@

 class TerminatorThread : public v8::internal::Thread {
  public:
-  TerminatorThread() : Thread("TerminatorThread") { }
+  explicit TerminatorThread(i::Isolate* isolate)
+      : Thread("TerminatorThread"),
+        isolate_(reinterpret_cast<v8::Isolate*>(isolate)) { }
   void Run() {
     semaphore->Wait();
-    CHECK(!v8::V8::IsExecutionTerminating());
-    v8::V8::TerminateExecution();
-  }
+    CHECK(!v8::V8::IsExecutionTerminating(isolate_));
+    v8::V8::TerminateExecution(isolate_);
+  }
+
+ private:
+  v8::Isolate* isolate_;
 };


@@ -173,7 +178,7 @@
 // from the side by another thread.
 TEST(TerminateOnlyV8ThreadFromOtherThread) {
   semaphore = v8::internal::OS::CreateSemaphore(0);
-  TerminatorThread thread;
+  TerminatorThread thread(i::Isolate::Current());
   thread.Start();

   v8::HandleScope scope;

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to