Commit 8c086c50 authored by kasperl@chromium.org's avatar kasperl@chromium.org

Try to fix issue 632 by being more careful in the locking/unlocking

in the test-log/ProfMultipleThreads.
Review URL: http://codereview.chromium.org/669058

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4021 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d3cf6cbf
......@@ -2909,10 +2909,6 @@ Persistent<Context> v8::Context::New(
i::Handle<i::Context> env;
{
ENTER_V8;
// BUG(632): Force GC to workaround instability issues.
i::Heap::CollectAllGarbage(false);
v8::Handle<ObjectTemplate> proxy_template = global_template;
i::Handle<i::FunctionTemplateInfo> proxy_constructor;
i::Handle<i::FunctionTemplateInfo> global_constructor;
......
......@@ -390,21 +390,24 @@ class LoopingThread : public v8::internal::Thread {
class LoopingJsThread : public LoopingThread {
public:
void RunLoop() {
{
v8::Locker locker;
CHECK(v8::internal::ThreadManager::HasId());
SetV8ThreadId();
}
v8::Locker locker;
CHECK(v8::internal::ThreadManager::HasId());
SetV8ThreadId();
while (IsRunning()) {
v8::Locker locker;
v8::HandleScope scope;
v8::Persistent<v8::Context> context = v8::Context::New();
v8::Context::Scope context_scope(context);
SignalRunning();
CompileAndRunScript(
"var j; for (var i=0; i<10000; ++i) { j = Math.sin(i); }");
CHECK(!context.IsEmpty());
{
v8::Context::Scope context_scope(context);
SignalRunning();
CompileAndRunScript(
"var j; for (var i=0; i<10000; ++i) { j = Math.sin(i); }");
}
context.Dispose();
i::OS::Sleep(1);
{
v8::Unlocker unlocker;
i::OS::Sleep(1);
}
}
}
};
......
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