Make style context use parking_lot::RwLock

This commit is contained in:
Xidorn Quan 2016-11-01 11:43:16 +11:00
parent 070dee3542
commit 09cbe3bce0
11 changed files with 23 additions and 15 deletions

View file

@ -605,11 +605,10 @@ trait PrivateMatchMethods: TElement {
// Merge any running transitions into the current style, and cancel them.
let had_running_animations = context.running_animations
.read()
.unwrap()
.get(&this_opaque)
.is_some();
if had_running_animations {
let mut all_running_animations = context.running_animations.write().unwrap();
let mut all_running_animations = context.running_animations.write();
for mut running_animation in all_running_animations.get_mut(&this_opaque).unwrap() {
// This shouldn't happen frequently, but under some
// circumstances mainly huge load or debug builds, the