Skip to content

Commit

Permalink
Bump crossbeam-utils to v0.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Stjepan Glavina committed Dec 8, 2018
1 parent 4b8a835 commit f974592
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions crossbeam-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Version 0.6.2

- Add `Parker`.
- Improve documentation.

# Version 0.6.1

- Fix a soundness bug in `Scope::spawn()`.
Expand Down
2 changes: 1 addition & 1 deletion crossbeam-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name = "crossbeam-utils"
# - Update CHANGELOG.md
# - Update README.md
# - Create "crossbeam-utils-X.Y.Z" git tag
version = "0.6.1"
version = "0.6.2"
authors = ["The Crossbeam Project Developers"]
license = "MIT/Apache-2.0"
readme = "README.md"
Expand Down
4 changes: 2 additions & 2 deletions crossbeam-utils/src/sync/parker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl Parker {
/// // Wakes up immediately and consumes the token.
/// p.park();
/// ```
pub fn park(&mut self) {
pub fn park(&self) {
self.unparker.inner.park(None);
}

Expand All @@ -121,7 +121,7 @@ impl Parker {
/// // Waits for the token to become available, but will not wait longer than 500 ms.
/// p.park_timeout(Duration::from_millis(500));
/// ```
pub fn park_timeout(&mut self, timeout: Duration) {
pub fn park_timeout(&self, timeout: Duration) {
self.unparker.inner.park(Some(timeout));
}

Expand Down
6 changes: 3 additions & 3 deletions crossbeam-utils/tests/parker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crossbeam_utils::thread;

#[test]
fn park_timeout_unpark_before() {
let mut p = Parker::new();
let p = Parker::new();
for _ in 0..10 {
p.unparker().unpark();
p.park_timeout(Duration::from_millis(u32::MAX as u64));
Expand All @@ -18,7 +18,7 @@ fn park_timeout_unpark_before() {

#[test]
fn park_timeout_unpark_not_called() {
let mut p = Parker::new();
let p = Parker::new();
for _ in 0..10 {
p.park_timeout(Duration::from_millis(10));
}
Expand All @@ -27,7 +27,7 @@ fn park_timeout_unpark_not_called() {
#[test]
fn park_timeout_unpark_called_other_thread() {
for _ in 0..10 {
let mut p = Parker::new();
let p = Parker::new();
let u = p.unparker().clone();

thread::scope(|scope| {
Expand Down

0 comments on commit f974592

Please sign in to comment.