mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Move more foundational types to script_bindings (#35280)
* script: Move DOMClass to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move DOMJSClass and get_dom_class to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Move Castable/DerivedFrom/IDLInterface to script_bindings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
eaaad757e8
commit
c0cef69108
16 changed files with 291 additions and 207 deletions
17
components/script_bindings/script_runtime.rs
Normal file
17
components/script_bindings/script_runtime.rs
Normal file
|
@ -0,0 +1,17 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use std::cell::Cell;
|
||||
|
||||
thread_local!(
|
||||
static THREAD_ACTIVE: Cell<bool> = const { Cell::new(true) };
|
||||
);
|
||||
|
||||
pub fn runtime_is_alive() -> bool {
|
||||
THREAD_ACTIVE.with(|t| t.get())
|
||||
}
|
||||
|
||||
pub fn mark_runtime_dead() {
|
||||
THREAD_ACTIVE.with(|t| t.set(false));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue