Add a Servo_IsWorkerThread API.

This commit is contained in:
Bobby Holley 2017-09-18 18:26:29 -07:00
parent a5282cabe0
commit bc1d91e584
2 changed files with 8 additions and 0 deletions

View file

@ -2929,6 +2929,9 @@ extern "C" {
extern "C" { extern "C" {
pub fn Servo_AssertTreeIsClean(root: RawGeckoElementBorrowed); pub fn Servo_AssertTreeIsClean(root: RawGeckoElementBorrowed);
} }
extern "C" {
pub fn Servo_IsWorkerThread() -> bool;
}
extern "C" { extern "C" {
pub fn Servo_MaybeGCRuleTree(set: RawServoStyleSetBorrowed); pub fn Servo_MaybeGCRuleTree(set: RawServoStyleSetBorrowed);
} }

View file

@ -3483,6 +3483,11 @@ pub extern "C" fn Servo_AssertTreeIsClean(root: RawGeckoElementBorrowed) {
assert_subtree_is_clean(root); assert_subtree_is_clean(root);
} }
#[no_mangle]
pub extern "C" fn Servo_IsWorkerThread() -> bool {
thread_state::get().is_worker()
}
enum Offset { enum Offset {
Zero, Zero,
One One