Auto merge of #18137 - bholley:thread_pool_parent_process, r=upsuper

Avoid creating a stylo thread pool in e10s parent processes

Reviewed in https://bugzilla.mozilla.org/show_bug.cgi?id=1375911

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18137)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-08-17 22:28:34 -05:00 committed by GitHub
commit 489b25004b
2 changed files with 5 additions and 1 deletions

View file

@ -1568,6 +1568,9 @@ extern "C" {
extern "C" { extern "C" {
pub fn Gecko_RegisterNamespace(ns: *mut nsIAtom) -> i32; pub fn Gecko_RegisterNamespace(ns: *mut nsIAtom) -> i32;
} }
extern "C" {
pub fn Gecko_ShouldCreateStyleThreadPool() -> bool;
}
extern "C" { extern "C" {
pub fn Gecko_Construct_Default_nsStyleFont(ptr: *mut nsStyleFont, pub fn Gecko_Construct_Default_nsStyleFont(ptr: *mut nsStyleFont,
pres_context: pres_context:

View file

@ -5,6 +5,7 @@
//! Global style data //! Global style data
use context::StyleSystemOptions; use context::StyleSystemOptions;
use gecko_bindings::bindings;
use gecko_bindings::bindings::{Gecko_RegisterProfilerThread, Gecko_UnregisterProfilerThread}; use gecko_bindings::bindings::{Gecko_RegisterProfilerThread, Gecko_UnregisterProfilerThread};
use gecko_bindings::bindings::Gecko_SetJemallocThreadLocalArena; use gecko_bindings::bindings::Gecko_SetJemallocThreadLocalArena;
use num_cpus; use num_cpus;
@ -78,7 +79,7 @@ lazy_static! {
} }
} }
let pool = if num_threads < 1 { let pool = if num_threads < 1 || unsafe { !bindings::Gecko_ShouldCreateStyleThreadPool() } {
None None
} else { } else {
let configuration = rayon::Configuration::new() let configuration = rayon::Configuration::new()