trying to fix test

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8256 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 6891dd20
......@@ -3099,7 +3099,7 @@ class V8EXPORT V8 {
* 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
......
......@@ -4902,9 +4902,10 @@ void V8::TerminateExecution(Isolate* isolate) {
}
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);
}
......
......@@ -160,12 +160,17 @@ TEST(TerminateOnlyV8ThreadFromThreadItselfNoLoop) {
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 @@ class TerminatorThread : public v8::internal::Thread {
// 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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment