Mark the Gecko main thread as a Servo layout thread.

This is needed to keep the assertion in the RuleTree GC functions that checks
we're being called on the non-worker layout thread.
This commit is contained in:
Cameron McCormack 2016-11-18 17:01:05 +08:00
parent 48aa7070ac
commit 226c946817

View file

@ -46,6 +46,7 @@ use style::selector_parser::PseudoElementCascadeType;
use style::sequential;
use style::string_cache::Atom;
use style::stylesheets::{Origin, Stylesheet};
use style::thread_state;
use style::timer::Timer;
use style_traits::ToCss;
@ -66,6 +67,9 @@ pub extern "C" fn Servo_Initialize() -> () {
// Allocate our default computed values.
unsafe { ComputedValues::initialize(); }
// Pretend that we're a Servo Layout thread, to make some assertions happy.
thread_state::initialize(thread_state::LAYOUT);
}
#[no_mangle]