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

@ -672,7 +672,7 @@ pub fn complete_expired_transitions(node: OpaqueNode, style: &mut Arc<ComputedVa
context: &SharedStyleContext) -> bool {
let had_animations_to_expire;
{
let all_expired_animations = context.expired_animations.read().unwrap();
let all_expired_animations = context.expired_animations.read();
let animations_to_expire = all_expired_animations.get(&node);
had_animations_to_expire = animations_to_expire.is_some();
if let Some(ref animations) = animations_to_expire {
@ -686,7 +686,7 @@ pub fn complete_expired_transitions(node: OpaqueNode, style: &mut Arc<ComputedVa
}
if had_animations_to_expire {
context.expired_animations.write().unwrap().remove(&node);
context.expired_animations.write().remove(&node);
}
had_animations_to_expire