Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(674)

Unified Diff: src/libplatform/default-platform.cc

Issue 1553653002: [libplatform] allow thread_pool_size to be > 4 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/libplatform/default-platform.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/libplatform/default-platform.cc
diff --git a/src/libplatform/default-platform.cc b/src/libplatform/default-platform.cc
index e8c15572ad1106b97d161fad070dceeffdf6d25e..996701ea95deb7df9e418eb6b13230cf4f8df926 100644
--- a/src/libplatform/default-platform.cc
+++ b/src/libplatform/default-platform.cc
@@ -30,11 +30,13 @@ bool PumpMessageLoop(v8::Platform* platform, v8::Isolate* isolate) {
}
-const int DefaultPlatform::kMaxThreadPoolSize = 4;
+const int DefaultPlatform::kDefaultThreadPoolSize = 4;
DefaultPlatform::DefaultPlatform()
- : initialized_(false), thread_pool_size_(0) {}
+ : initialized_(false),
+ max_thread_pool_size_(base::SysInfo::NumberOfProcessors()),
+ thread_pool_size_(kDefaultThreadPoolSize) {}
DefaultPlatform::~DefaultPlatform() {
@@ -66,10 +68,10 @@ void DefaultPlatform::SetThreadPoolSize(int thread_pool_size) {
base::LockGuard<base::Mutex> guard(&lock_);
DCHECK(thread_pool_size >= 0);
if (thread_pool_size < 1) {
- thread_pool_size = base::SysInfo::NumberOfProcessors();
+ thread_pool_size = kDefaultThreadPoolSize;
}
thread_pool_size_ =
- std::max(std::min(thread_pool_size, kMaxThreadPoolSize), 1);
+ std::max(std::min(thread_pool_size, max_thread_pool_size_), 1);
jochen (gone - plz use gerrit) 2016/01/08 14:46:18 any reason you store this in a member instead of j
}
« no previous file with comments | « src/libplatform/default-platform.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698