Hi, All,
It seems that script v8::V8::TerminateExecution can't terminate the simplest
script like:
for (;;)
{
print("Still running");
}
Why??
Reproduction steps:
-----------------------------
There is a test-thread-termination.cc under project ccTest,
Change function Doloop to following, then the test case
"test-thread-termination/TerminateOnlyV8ThreadFromThreadItself" will fail
v8::Handle<v8::Value> DoLoop(const v8::Arguments& args) {
v8::TryCatch try_catch;
//v8::Script::Compile(v8::String::New("function f() {"
// " var term = true;"
// " try {"
// " while(true) {"
// " if (term) terminate();"
// " term = false;"
// " }"
// " fail();"
// " } catch(e) {"
// " fail();"
// " }"
// "}"
// "f()"))->Run();
v8::Script::Compile(v8::String::New("var term = true; while(true){if
(term) terminate(); term = false;}"))->Run();
CHECK(try_catch.HasCaught());
CHECK(try_catch.Exception()->IsNull());
CHECK(try_catch.Message().IsEmpty());
CHECK(!try_catch.CanContinue());
return v8::Undefined();
}
Does anyone encounter the same situation?
Sincerely~
Xiang
--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---