aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Vander Stoep <jeffv@google.com>2023-03-07 04:21:06 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-03-07 04:21:06 +0000
commit834f89918554a9f01b67e6a90259c6b772f07d1e (patch)
treef911dd6eba5c17815cb2681e4628e268a4613aed
parenteed4d29c1d0677a41c3142f63116416f61b5a1e7 (diff)
parente3a56896d695221b84f9852a2c78f0e6ececbcb4 (diff)
downloadcrossbeam-utils-834f89918554a9f01b67e6a90259c6b772f07d1e.tar.gz
Upgrade crossbeam-utils to 0.8.15 am: dd0849b1a0 am: 5064a245ad am: 7ce266baef am: e3a56896d6
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/crossbeam-utils/+/2469469 Change-Id: I75923a6abd3aef1dc9c03d0574b7c4bacef39679 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--.cargo_vcs_info.json2
-rw-r--r--Android.bp6
-rw-r--r--CHANGELOG.md6
-rw-r--r--Cargo.toml2
-rw-r--r--Cargo.toml.orig2
-rw-r--r--METADATA10
-rw-r--r--no_atomic.rs3
-rw-r--r--src/sync/parker.rs5
-rw-r--r--src/sync/sharded_lock.rs2
-rw-r--r--src/thread.rs2
-rw-r--r--tests/atomic_cell.rs6
11 files changed, 29 insertions, 17 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index cef469e..415facc 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,6 +1,6 @@
{
"git": {
- "sha1": "366276a4dde8bd6b4bdab531c09e6ab1ff38c407"
+ "sha1": "721382b00b5dadd81954ed66764d547e2f1bb7a3"
},
"path_in_vcs": "crossbeam-utils"
} \ No newline at end of file
diff --git a/Android.bp b/Android.bp
index 43b9d5a..5b4b500 100644
--- a/Android.bp
+++ b/Android.bp
@@ -44,7 +44,7 @@ rust_test {
host_supported: true,
crate_name: "crossbeam_utils",
cargo_env_compat: true,
- cargo_pkg_version: "0.8.14",
+ cargo_pkg_version: "0.8.15",
srcs: ["src/lib.rs"],
test_suites: ["general-tests"],
auto_gen_config: true,
@@ -67,7 +67,7 @@ rust_defaults {
name: "crossbeam-utils_test_defaults",
crate_name: "crossbeam_utils",
cargo_env_compat: true,
- cargo_pkg_version: "0.8.14",
+ cargo_pkg_version: "0.8.15",
test_suites: ["general-tests"],
auto_gen_config: true,
edition: "2018",
@@ -148,7 +148,7 @@ rust_library {
host_supported: true,
crate_name: "crossbeam_utils",
cargo_env_compat: true,
- cargo_pkg_version: "0.8.14",
+ cargo_pkg_version: "0.8.15",
srcs: ["src/lib.rs"],
edition: "2018",
features: [
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8e0fe35..994b6c3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+# Version 0.8.15
+
+- Add `#[clippy::has_significant_drop]` to `ShardedLock{Read,Write}Guard`. (#958)
+- Improve handling of very large timeout. (#953)
+- Soft-deprecate `thread::scope()` in favor of the more efficient `std::thread::scope` that stabilized on Rust 1.63. (#954)
+
# Version 0.8.14
- Fix build script bug introduced in 0.8.13. (#932)
diff --git a/Cargo.toml b/Cargo.toml
index 6fe3f9f..a99b591 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@
edition = "2018"
rust-version = "1.38"
name = "crossbeam-utils"
-version = "0.8.14"
+version = "0.8.15"
description = "Utilities for concurrent programming"
homepage = "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-utils"
readme = "README.md"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 1674775..155fcc1 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -4,7 +4,7 @@ name = "crossbeam-utils"
# - Update CHANGELOG.md
# - Update README.md
# - Create "crossbeam-utils-X.Y.Z" git tag
-version = "0.8.14"
+version = "0.8.15"
edition = "2018"
rust-version = "1.38"
license = "MIT OR Apache-2.0"
diff --git a/METADATA b/METADATA
index a114c69..8121ef5 100644
--- a/METADATA
+++ b/METADATA
@@ -11,13 +11,13 @@ third_party {
}
url {
type: ARCHIVE
- value: "https://static.crates.io/crates/crossbeam-utils/crossbeam-utils-0.8.14.crate"
+ value: "https://static.crates.io/crates/crossbeam-utils/crossbeam-utils-0.8.15.crate"
}
- version: "0.8.14"
+ version: "0.8.15"
license_type: NOTICE
last_upgrade_date {
- year: 2022
- month: 12
- day: 8
+ year: 2023
+ month: 3
+ day: 6
}
}
diff --git a/no_atomic.rs b/no_atomic.rs
index 8ce0d31..beb11b0 100644
--- a/no_atomic.rs
+++ b/no_atomic.rs
@@ -28,6 +28,7 @@ const NO_ATOMIC_64: &[&str] = &[
"armv5te-unknown-linux-musleabi",
"armv5te-unknown-linux-uclibceabi",
"armv6k-nintendo-3ds",
+ "armv7-sony-vita-newlibeabihf",
"armv7r-none-eabi",
"armv7r-none-eabihf",
"avr-unknown-gnu-atmega328",
@@ -74,6 +75,8 @@ const NO_ATOMIC_64: &[&str] = &[
#[allow(dead_code)] // Only crossbeam-utils uses this.
const NO_ATOMIC: &[&str] = &[
"avr-unknown-gnu-atmega328",
+ "bpfeb-unknown-none",
+ "bpfel-unknown-none",
"mipsel-sony-psx",
"msp430-none-elf",
"riscv32i-unknown-none-elf",
diff --git a/src/sync/parker.rs b/src/sync/parker.rs
index e791c44..9cb3a26 100644
--- a/src/sync/parker.rs
+++ b/src/sync/parker.rs
@@ -122,7 +122,10 @@ impl Parker {
/// p.park_timeout(Duration::from_millis(500));
/// ```
pub fn park_timeout(&self, timeout: Duration) {
- self.park_deadline(Instant::now() + timeout)
+ match Instant::now().checked_add(timeout) {
+ Some(deadline) => self.park_deadline(deadline),
+ None => self.park(),
+ }
}
/// Blocks the current thread until the token is made available, or until a certain deadline.
diff --git a/src/sync/sharded_lock.rs b/src/sync/sharded_lock.rs
index b43c55e..a8f4584 100644
--- a/src/sync/sharded_lock.rs
+++ b/src/sync/sharded_lock.rs
@@ -480,6 +480,7 @@ impl<T> From<T> for ShardedLock<T> {
}
/// A guard used to release the shared read access of a [`ShardedLock`] when dropped.
+#[clippy::has_significant_drop]
pub struct ShardedLockReadGuard<'a, T: ?Sized> {
lock: &'a ShardedLock<T>,
_guard: RwLockReadGuard<'a, ()>,
@@ -511,6 +512,7 @@ impl<T: ?Sized + fmt::Display> fmt::Display for ShardedLockReadGuard<'_, T> {
}
/// A guard used to release the exclusive write access of a [`ShardedLock`] when dropped.
+#[clippy::has_significant_drop]
pub struct ShardedLockWriteGuard<'a, T: ?Sized> {
lock: &'a ShardedLock<T>,
_marker: PhantomData<RwLockWriteGuard<'a, T>>,
diff --git a/src/thread.rs b/src/thread.rs
index f1086d9..7446454 100644
--- a/src/thread.rs
+++ b/src/thread.rs
@@ -133,6 +133,8 @@ type SharedOption<T> = Arc<Mutex<Option<T>>>;
/// returned containing errors from panicked threads. Note that if panics are implemented by
/// aborting the process, no error is returned; see the notes of [std::panic::catch_unwind].
///
+/// **Note:** Since Rust 1.63, this function is soft-deprecated in favor of the more efficient [`std::thread::scope`].
+///
/// # Examples
///
/// ```
diff --git a/tests/atomic_cell.rs b/tests/atomic_cell.rs
index a1d1022..edb7a4b 100644
--- a/tests/atomic_cell.rs
+++ b/tests/atomic_cell.rs
@@ -35,11 +35,7 @@ fn is_lock_free() {
// of `AtomicU64` is `8`, so `AtomicCell<u64>` is not lock-free.
assert_eq!(
AtomicCell::<u64>::is_lock_free(),
- cfg!(not(crossbeam_no_atomic_64))
- && cfg!(any(
- target_pointer_width = "64",
- target_pointer_width = "128"
- ))
+ cfg!(not(crossbeam_no_atomic_64)) && std::mem::align_of::<u64>() == 8
);
assert_eq!(mem::size_of::<U64Align8>(), 8);
assert_eq!(mem::align_of::<U64Align8>(), 8);