diff options
| author | 2015-07-08 15:40:42 +0000 | |
|---|---|---|
| committer | 2015-07-08 15:40:44 +0000 | |
| commit | dcf8837d4902ea50f2421eecde64fe55e3d98b28 (patch) | |
| tree | 7837fb34c2789feb24237de2f123439d31d0a5ee | |
| parent | 4c0c6739d6b22ac84f24d53250e239f5e97b5470 (diff) | |
| parent | c452654a4571ef010a00cef79f82b6b2179704f6 (diff) | |
Merge "Restrict number of hwuiTask threads" into mnc-dr-dev
| -rw-r--r-- | libs/hwui/thread/TaskManager.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/hwui/thread/TaskManager.cpp b/libs/hwui/thread/TaskManager.cpp index f0ed0bbfedc1..e9dde294b2aa 100644 --- a/libs/hwui/thread/TaskManager.cpp +++ b/libs/hwui/thread/TaskManager.cpp @@ -33,7 +33,9 @@ TaskManager::TaskManager() { // Get the number of available CPUs. This value does not change over time. int cpuCount = sysconf(_SC_NPROCESSORS_CONF); - int workerCount = MathUtils::max(1, cpuCount / 2); + // Really no point in making more than 2 of these worker threads, but + // we do want to limit ourselves to 1 worker thread on dual-core devices. + int workerCount = cpuCount > 2 ? 2 : 1; for (int i = 0; i < workerCount; i++) { String8 name; name.appendFormat("hwuiTask%d", i + 1); |