From 851b3e32bd1dd224889de12a87fa57bab091346a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Sun, 8 Oct 2017 12:54:29 +0200 Subject: [PATCH] style: allow re-initializing thread_state as long as it's with the same value. This unbusts running multiple rule-tree benchmarks at the same time. --- components/style/thread_state.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/style/thread_state.rs b/components/style/thread_state.rs index 894cdb4a813..d06f47aabe4 100644 --- a/components/style/thread_state.rs +++ b/components/style/thread_state.rs @@ -53,7 +53,9 @@ thread_local!(static STATE: RefCell> = RefCell::new(None)); pub fn initialize(x: ThreadState) { STATE.with(|ref k| { if let Some(ref s) = *k.borrow() { - panic!("Thread state already initialized as {:?}", s); + if x != *s { + panic!("Thread state already initialized as {:?}", s); + } } *k.borrow_mut() = Some(x); });