mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Avoid dropping the other threads' TLS contexts too early.
When collecting style statistics, we have this path that moves the TLS contexts to be dropped before the local context. Since destroying the TLS context runs the sequential task queue, that means that sequential tasks would be executed sooner than usual, before we drop the main thread TLS context. Since we have that reuse of the main thread context's bloom filter, and some tasks end up creating one (Servo_StyleSet_GetBaseComputedValuesForElement, I'm looking at you), we may borrow the bloom filter before we're done with it on the traversal code path. This was hitting on YouTube, when DUMP_STYLE_STATISTICS was used.
This commit is contained in:
parent
862f3b4369
commit
2d1b387a4c
1 changed files with 1 additions and 1 deletions
|
@ -115,7 +115,7 @@ where
|
||||||
let mut aggregate =
|
let mut aggregate =
|
||||||
mem::replace(&mut context.thread_local.statistics, Default::default());
|
mem::replace(&mut context.thread_local.statistics, Default::default());
|
||||||
let parallel = maybe_tls.is_some();
|
let parallel = maybe_tls.is_some();
|
||||||
if let Some(tls) = maybe_tls {
|
if let Some(ref mut tls) = maybe_tls {
|
||||||
let slots = unsafe { tls.unsafe_get() };
|
let slots = unsafe { tls.unsafe_get() };
|
||||||
aggregate = slots.iter().fold(aggregate, |acc, t| {
|
aggregate = slots.iter().fold(aggregate, |acc, t| {
|
||||||
match *t.borrow() {
|
match *t.borrow() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue