зеркало из https://github.com/mozilla/gecko-dev.git
Bug 855923 - Set the multithreaded image decoding thread pool's idle thread limit in addition to the regular thread limit. r=seth
This commit is contained in:
Родитель
3cbe6fe633
Коммит
becc8be326
|
@ -3522,12 +3522,16 @@ RasterImage::DecodePool::DecodePool()
|
|||
mThreadPool = do_CreateInstance(NS_THREADPOOL_CONTRACTID);
|
||||
if (mThreadPool) {
|
||||
mThreadPool->SetName(NS_LITERAL_CSTRING("ImageDecoder"));
|
||||
uint32_t limit;
|
||||
if (gDecodingThreadLimit <= 0) {
|
||||
mThreadPool->SetThreadLimit(std::max(PR_GetNumberOfProcessors() - 1, 1));
|
||||
limit = std::max(PR_GetNumberOfProcessors(), 2) - 1;
|
||||
} else {
|
||||
mThreadPool->SetThreadLimit(static_cast<uint32_t>(gDecodingThreadLimit));
|
||||
limit = static_cast<uint32_t>(gDecodingThreadLimit);
|
||||
}
|
||||
|
||||
mThreadPool->SetThreadLimit(limit);
|
||||
mThreadPool->SetIdleThreadLimit(limit);
|
||||
|
||||
nsCOMPtr<nsIObserverService> obsSvc = mozilla::services::GetObserverService();
|
||||
if (obsSvc) {
|
||||
obsSvc->AddObserver(this, "xpcom-shutdown-threads", false);
|
||||
|
|
Загрузка…
Ссылка в новой задаче