From 37879260a962e8c23a37e15e8b6f7e83ba043e29 Mon Sep 17 00:00:00 2001 From: Blake Kaplan Date: Tue, 19 Sep 2017 16:30:41 -0700 Subject: [PATCH] Bug 1398393 - Add a way to initialize a cooperative thread in servo. --- ports/geckolib/glue.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 92735be556c..730ab00f103 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -182,6 +182,12 @@ pub extern "C" fn Servo_Initialize(dummy_url_data: *mut URLExtraData) { unsafe { DUMMY_URL_DATA = dummy_url_data; } } +#[no_mangle] +pub extern "C" fn Servo_InitializeCooperativeThread() { + // Pretend that we're a Servo Layout thread to make some assertions happy. + thread_state::initialize(thread_state::LAYOUT); +} + #[no_mangle] pub extern "C" fn Servo_Shutdown() { // The dummy url will be released after shutdown, so clear the