Skip to content

Commit

Permalink
Update parking_lot to 0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Eijebong committed Jul 19, 2018
1 parent 908a642 commit ba9cbd8
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 25 deletions.
38 changes: 24 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/layout/Cargo.toml
Expand Up @@ -28,7 +28,7 @@ malloc_size_of = { path = "../malloc_size_of" }
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
new-ordered-float = "1.0"
parking_lot = "0.5"
parking_lot = "0.6"
profile_traits = {path = "../profile_traits"}
range = {path = "../range"}
rayon = "1"
Expand Down
2 changes: 1 addition & 1 deletion components/layout_thread/Cargo.toml
Expand Up @@ -33,7 +33,7 @@ malloc_size_of = { path = "../malloc_size_of" }
metrics = {path = "../metrics"}
msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
parking_lot = "0.5"
parking_lot = "0.6"
profile_traits = {path = "../profile_traits"}
range = {path = "../range"}
rayon = "1"
Expand Down
2 changes: 1 addition & 1 deletion components/script/Cargo.toml
Expand Up @@ -70,7 +70,7 @@ msg = {path = "../msg"}
net_traits = {path = "../net_traits"}
num-traits = "0.1.32"
offscreen_gl_context = {version = "0.20", features = ["serde"]}
parking_lot = "0.5"
parking_lot = "0.6"
phf = "0.7.18"
profile_traits = {path = "../profile_traits"}
ref_filter_map = "1.0.1"
Expand Down
2 changes: 1 addition & 1 deletion components/style/Cargo.toml
Expand Up @@ -51,7 +51,7 @@ num-integer = "0.1.32"
num-traits = "0.1.32"
new-ordered-float = "1.0"
owning_ref = "0.3.3"
parking_lot = "0.5"
parking_lot = "0.6"
precomputed-hash = "0.1.1"
rayon = "1"
selectors = { path = "../selectors" }
Expand Down
14 changes: 8 additions & 6 deletions components/style/shared_lock.rs
Expand Up @@ -11,6 +11,8 @@ use parking_lot::RwLock;
use servo_arc::Arc;
use std::cell::UnsafeCell;
use std::fmt;
#[cfg(feature = "servo")]
use std::mem;
#[cfg(feature = "gecko")]
use std::ptr;
use str::{CssString, CssStringWriter};
Expand Down Expand Up @@ -74,7 +76,7 @@ impl SharedRwLock {
/// Obtain the lock for reading (servo).
#[cfg(feature = "servo")]
pub fn read(&self) -> SharedRwLockReadGuard {
self.arc.raw_read();
mem::forget(self.arc.read());
SharedRwLockReadGuard(self)
}

Expand All @@ -87,7 +89,7 @@ impl SharedRwLock {
/// Obtain the lock for writing (servo).
#[cfg(feature = "servo")]
pub fn write(&self) -> SharedRwLockWriteGuard {
self.arc.raw_write();
mem::forget(self.arc.write());
SharedRwLockWriteGuard(self)
}

Expand All @@ -107,9 +109,9 @@ pub struct SharedRwLockReadGuard<'a>(AtomicRef<'a, SomethingZeroSizedButTyped>);
#[cfg(feature = "servo")]
impl<'a> Drop for SharedRwLockReadGuard<'a> {
fn drop(&mut self) {
// Unsafe: self.lock is private to this module, only ever set after `raw_read()`,
// Unsafe: self.lock is private to this module, only ever set after `read()`,
// and never copied or cloned (see `compile_time_assert` below).
unsafe { self.0.arc.raw_unlock_read() }
unsafe { self.0.arc.force_unlock_read() }
}
}

Expand All @@ -122,9 +124,9 @@ pub struct SharedRwLockWriteGuard<'a>(AtomicRefMut<'a, SomethingZeroSizedButType
#[cfg(feature = "servo")]
impl<'a> Drop for SharedRwLockWriteGuard<'a> {
fn drop(&mut self) {
// Unsafe: self.lock is private to this module, only ever set after `raw_write()`,
// Unsafe: self.lock is private to this module, only ever set after `write()`,
// and never copied or cloned (see `compile_time_assert` below).
unsafe { self.0.arc.raw_unlock_write() }
unsafe { self.0.arc.force_unlock_write() }
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/style/Cargo.toml
Expand Up @@ -15,7 +15,7 @@ app_units = "0.6"
cssparser = "0.24.0"
euclid = "0.18"
html5ever = "0.22"
parking_lot = "0.5"
parking_lot = "0.6"
rayon = "1"
serde_json = "1.0"
selectors = {path = "../../../components/selectors"}
Expand Down

0 comments on commit ba9cbd8

Please sign in to comment.