am 62a65071: am dcf8837d: Merge "Restrict number of hwuiTask threads" into mnc-dr-dev

* commit '62a650715df7aa29c9913d8bb064a8845eeda110':
  Restrict number of hwuiTask threads
This commit is contained in:
John Reck
2015-07-08 16:07:18 +00:00
committed by Android Git Automerger

View File

@@ -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);