Skip to content

Commit

Permalink
Mark the Gecko main thread as a Servo layout thread.
Browse files Browse the repository at this point in the history
This is needed to keep the assertion in the RuleTree GC functions that checks
we're being called on the non-worker layout thread.
  • Loading branch information
heycam committed Nov 21, 2016
1 parent 48aa707 commit 226c946
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ports/geckolib/glue.rs
Expand Up @@ -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;

Expand All @@ -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]
Expand Down

0 comments on commit 226c946

Please sign in to comment.