Commit 5275240e authored by jochen@chromium.org's avatar jochen@chromium.org

Ensure that the worker pool is running if we intend to use it

BUG=none
R=hpayer@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/170483002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19519 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1d8997db
...@@ -50,6 +50,8 @@ class DefaultPlatform : public Platform { ...@@ -50,6 +50,8 @@ class DefaultPlatform : public Platform {
void SetThreadPoolSize(int thread_pool_size); void SetThreadPoolSize(int thread_pool_size);
void EnsureInitialized();
// v8::Platform implementation. // v8::Platform implementation.
virtual void CallOnBackgroundThread( virtual void CallOnBackgroundThread(
Task *task, ExpectedRuntime expected_runtime) V8_OVERRIDE; Task *task, ExpectedRuntime expected_runtime) V8_OVERRIDE;
...@@ -59,8 +61,6 @@ class DefaultPlatform : public Platform { ...@@ -59,8 +61,6 @@ class DefaultPlatform : public Platform {
private: private:
static const int kMaxThreadPoolSize = 4; static const int kMaxThreadPoolSize = 4;
void EnsureInitialized();
Mutex lock_; Mutex lock_;
bool initialized_; bool initialized_;
int thread_pool_size_; int thread_pool_size_;
......
...@@ -82,6 +82,8 @@ bool V8::Initialize(Deserializer* des) { ...@@ -82,6 +82,8 @@ bool V8::Initialize(Deserializer* des) {
#ifdef V8_USE_DEFAULT_PLATFORM #ifdef V8_USE_DEFAULT_PLATFORM
DefaultPlatform* platform = static_cast<DefaultPlatform*>(platform_); DefaultPlatform* platform = static_cast<DefaultPlatform*>(platform_);
platform->SetThreadPoolSize(isolate->max_available_threads()); platform->SetThreadPoolSize(isolate->max_available_threads());
// We currently only start the threads early, if we know that we'll use them.
if (FLAG_job_based_sweeping) platform->EnsureInitialized();
#endif #endif
return isolate->Init(des); return isolate->Init(des);
......
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