diff options
author | Jeff Vander Stoep <jeffv@google.com> | 2020-10-22 10:21:16 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-10-22 10:21:16 +0000 |
commit | 8ddb9cbc64a4707c5f744be40839bce54bb735b4 (patch) | |
tree | 2fd512ac97a64c843efd572491843de99729e2f3 | |
parent | 1914a69e2a449281aeee437f7b41446e7314a0d7 (diff) | |
parent | 3bd6148dbf557b6b06e9c55e813a9d22a5a59f4a (diff) | |
download | parking_lot_core-8ddb9cbc64a4707c5f744be40839bce54bb735b4.tar.gz |
Update parking_lot_core to version 0.8.0 am: 3bd6148dbf
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/parking_lot_core/+/1469394
Change-Id: I223dc99e4d71fd1be64594cd623bf399d9cda933
-rw-r--r-- | .cargo_vcs_info.json | 2 | ||||
-rw-r--r-- | Android.bp | 3 | ||||
-rw-r--r-- | Cargo.toml | 23 | ||||
-rw-r--r-- | Cargo.toml.orig | 21 | ||||
-rw-r--r-- | METADATA | 6 | ||||
-rw-r--r-- | src/parking_lot.rs | 7 | ||||
-rw-r--r-- | src/thread_parker/cloudabi.rs | 13 | ||||
-rw-r--r-- | src/thread_parker/generic.rs | 3 | ||||
-rw-r--r-- | src/thread_parker/linux.rs | 3 | ||||
-rw-r--r-- | src/thread_parker/mod.rs | 2 | ||||
-rw-r--r-- | src/thread_parker/redox.rs | 3 | ||||
-rw-r--r-- | src/thread_parker/sgx.rs | 2 | ||||
-rw-r--r-- | src/thread_parker/unix.rs | 6 | ||||
-rw-r--r-- | src/thread_parker/wasm.rs | 3 | ||||
-rw-r--r-- | src/thread_parker/wasm_atomic.rs | 3 | ||||
-rw-r--r-- | src/thread_parker/windows/keyed_event.rs | 6 | ||||
-rw-r--r-- | src/thread_parker/windows/mod.rs | 2 | ||||
-rw-r--r-- | src/thread_parker/windows/waitaddress.rs | 2 |
18 files changed, 60 insertions, 50 deletions
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index a0aa95c..ef88cf4 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,5 +1,5 @@ { "git": { - "sha1": "f48be0bf266e669ced83b1ab2ac017451cb53c98" + "sha1": "8c154bedcb392b87feea9b29054f3f0cabcd6a28" } } @@ -8,6 +8,7 @@ rust_library { edition: "2018", rustlibs: [ "libcfg_if", + "libinstant", "liblibc", "libsmallvec", ], @@ -22,6 +23,7 @@ rust_defaults { edition: "2018", rustlibs: [ "libcfg_if", + "libinstant", "liblibc", "libsmallvec", ], @@ -39,5 +41,6 @@ rust_test { // dependent_library ["feature_list"] // cfg-if-0.1.10 +// instant-0.1.7 // libc-0.2.79 "default,std" // smallvec-1.4.2 @@ -13,7 +13,7 @@ [package] edition = "2018" name = "parking_lot_core" -version = "0.7.2" +version = "0.8.0" authors = ["Amanieu d'Antras <amanieu@gmail.com>"] description = "An advanced API for creating custom synchronization primitives." keywords = ["mutex", "condvar", "rwlock", "once", "thread"] @@ -21,32 +21,35 @@ categories = ["concurrency"] license = "Apache-2.0/MIT" repository = "https://github.com/Amanieu/parking_lot" [dependencies.backtrace] -version = "0.3.2" +version = "0.3.49" optional = true [dependencies.cfg-if] -version = "0.1.5" +version = "0.1.10" + +[dependencies.instant] +version = "0.1.4" [dependencies.petgraph] -version = "0.5" +version = "0.5.1" optional = true [dependencies.smallvec] -version = "1.0" +version = "1.4.0" [dependencies.thread-id] -version = "3.2.0" +version = "3.3.0" optional = true [features] deadlock_detection = ["petgraph", "thread-id", "backtrace"] nightly = [] [target."cfg(target_os = \"cloudabi\")".dependencies.cloudabi] -version = "0.0.3" +version = "0.1.0" [target."cfg(target_os = \"redox\")".dependencies.redox_syscall] -version = "0.1" +version = "0.1.56" [target."cfg(unix)".dependencies.libc] -version = "0.2.55" +version = "0.2.71" [target."cfg(windows)".dependencies.winapi] -version = "0.3" +version = "0.3.8" features = ["winnt", "ntstatus", "minwindef", "winerror", "winbase", "errhandlingapi", "handleapi"] diff --git a/Cargo.toml.orig b/Cargo.toml.orig index f5a91d4..44903ca 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "parking_lot_core" -version = "0.7.2" +version = "0.8.0" authors = ["Amanieu d'Antras <amanieu@gmail.com>"] description = "An advanced API for creating custom synchronization primitives." license = "Apache-2.0/MIT" @@ -10,23 +10,24 @@ categories = ["concurrency"] edition = "2018" [dependencies] -cfg-if = "0.1.5" -smallvec = "1.0" -petgraph = { version = "0.5", optional = true } -thread-id = { version = "3.2.0", optional = true } -backtrace = { version = "0.3.2", optional = true } +cfg-if = "0.1.10" +smallvec = "1.4.0" +petgraph = { version = "0.5.1", optional = true } +thread-id = { version = "3.3.0", optional = true } +backtrace = { version = "0.3.49", optional = true } +instant = "0.1.4" [target.'cfg(unix)'.dependencies] -libc = "0.2.55" +libc = "0.2.71" [target.'cfg(target_os = "redox")'.dependencies] -redox_syscall = "0.1" +redox_syscall = "0.1.56" [target.'cfg(target_os = "cloudabi")'.dependencies] -cloudabi = "0.0.3" +cloudabi = "0.1.0" [target.'cfg(windows)'.dependencies] -winapi = { version = "0.3", features = ["winnt", "ntstatus", "minwindef", +winapi = { version = "0.3.8", features = ["winnt", "ntstatus", "minwindef", "winerror", "winbase", "errhandlingapi", "handleapi"] } [features] @@ -7,13 +7,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/parking_lot_core/parking_lot_core-0.7.2.crate" + value: "https://static.crates.io/crates/parking_lot_core/parking_lot_core-0.8.0.crate" } - version: "0.7.2" + version: "0.8.0" license_type: NOTICE last_upgrade_date { year: 2020 month: 10 - day: 14 + day: 20 } } diff --git a/src/parking_lot.rs b/src/parking_lot.rs index 440b7c7..1bd19eb 100644 --- a/src/parking_lot.rs +++ b/src/parking_lot.rs @@ -4,17 +4,18 @@ // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or // http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according to those terms. -use cfg_if::cfg_if; use crate::thread_parker::{ThreadParker, ThreadParkerT, UnparkHandleT}; use crate::util::UncheckedOptionExt; use crate::word_lock::WordLock; +use cfg_if::cfg_if; use core::{ cell::{Cell, UnsafeCell}, ptr, sync::atomic::{AtomicPtr, AtomicUsize, Ordering}, }; +use instant::Instant; use smallvec::SmallVec; -use std::time::{Duration, Instant}; +use std::time::Duration; cfg_if! { if #[cfg(all( @@ -51,7 +52,7 @@ cfg_if! { // See https://github.com/rust-lang/rust/blob/master/src/libstd/sys/wasm/time.rs type InstantType = DummyInstant; } else { - // Otherwise use `std::time::Instant` + // Otherwise use `instant::Instant` type InstantType = Instant; } } diff --git a/src/thread_parker/cloudabi.rs b/src/thread_parker/cloudabi.rs index 520cc72..2c5237f 100644 --- a/src/thread_parker/cloudabi.rs +++ b/src/thread_parker/cloudabi.rs @@ -11,7 +11,8 @@ use core::{ mem::{self, MaybeUninit}, sync::atomic::{AtomicU32, Ordering}, }; -use std::{convert::TryFrom, thread, time::Instant}; +use instant::Instant; +use std::{convert::TryFrom, thread}; extern "C" { #[thread_local] @@ -61,7 +62,7 @@ impl Lock { self.try_lock().unwrap_or_else(|| { // Call into the kernel to acquire a write lock. let subscription = abi::subscription { - type_: abi::eventtype::LOCK_WRLOCK, + r#type: abi::eventtype::LOCK_WRLOCK, union: abi::subscription_union { lock: abi::subscription_lock { lock: self.ptr(), @@ -135,7 +136,7 @@ impl Condvar { pub fn wait(&self, lock: &LockGuard) { unsafe { let subscription = abi::subscription { - type_: abi::eventtype::CONDVAR, + r#type: abi::eventtype::CONDVAR, union: abi::subscription_union { condvar: abi::subscription_condvar { condvar: self.ptr(), @@ -161,7 +162,7 @@ impl Condvar { unsafe { let subscriptions = [ abi::subscription { - type_: abi::eventtype::CONDVAR, + r#type: abi::eventtype::CONDVAR, union: abi::subscription_union { condvar: abi::subscription_condvar { condvar: self.ptr(), @@ -173,7 +174,7 @@ impl Condvar { ..mem::zeroed() }, abi::subscription { - type_: abi::eventtype::CLOCK, + r#type: abi::eventtype::CLOCK, union: abi::subscription_union { clock: abi::subscription_clock { clock_id: abi::clockid::MONOTONIC, @@ -197,7 +198,7 @@ impl Condvar { let events = events.assume_init(); for i in 0..nevents { debug_assert_eq!(events[i].error, abi::errno::SUCCESS); - if events[i].type_ == abi::eventtype::CONDVAR { + if events[i].r#type == abi::eventtype::CONDVAR { return true; } } diff --git a/src/thread_parker/generic.rs b/src/thread_parker/generic.rs index 3ee837a..5236e14 100644 --- a/src/thread_parker/generic.rs +++ b/src/thread_parker/generic.rs @@ -9,7 +9,8 @@ //! parking facilities available. use core::sync::atomic::{spin_loop_hint, AtomicBool, Ordering}; -use std::{thread, time::Instant}; +use instant::Instant; +use std::thread; // Helper type for putting a thread to sleep until some other thread wakes it up pub struct ThreadParker { diff --git a/src/thread_parker/linux.rs b/src/thread_parker/linux.rs index 04f66a7..766e63b 100644 --- a/src/thread_parker/linux.rs +++ b/src/thread_parker/linux.rs @@ -9,8 +9,9 @@ use core::{ ptr, sync::atomic::{AtomicI32, Ordering}, }; +use instant::Instant; use libc; -use std::{thread, time::Instant}; +use std::thread; // x32 Linux uses a non-standard type for tv_nsec in timespec. // See https://sourceware.org/bugzilla/show_bug.cgi?id=16437 diff --git a/src/thread_parker/mod.rs b/src/thread_parker/mod.rs index 4c721c3..3d00bfc 100644 --- a/src/thread_parker/mod.rs +++ b/src/thread_parker/mod.rs @@ -1,5 +1,5 @@ use cfg_if::cfg_if; -use std::time::Instant; +use instant::Instant; /// Trait for the platform thread parker implementation. /// diff --git a/src/thread_parker/redox.rs b/src/thread_parker/redox.rs index 97ffc8a..cac06bc 100644 --- a/src/thread_parker/redox.rs +++ b/src/thread_parker/redox.rs @@ -9,7 +9,8 @@ use core::{ ptr, sync::atomic::{AtomicI32, Ordering}, }; -use std::{thread, time::Instant}; +use instant::Instant; +use std::thread; use syscall::{ call::futex, data::TimeSpec, diff --git a/src/thread_parker/sgx.rs b/src/thread_parker/sgx.rs index 56fc65a..341efe2 100644 --- a/src/thread_parker/sgx.rs +++ b/src/thread_parker/sgx.rs @@ -6,6 +6,7 @@ // copied, modified, or distributed except according to those terms. use core::sync::atomic::{AtomicBool, Ordering}; +use instant::Instant; use std::{ io, os::fortanix_sgx::{ @@ -16,7 +17,6 @@ use std::{ }, }, thread, - time::Instant, }; // Helper type for putting a thread to sleep until some other thread wakes it up diff --git a/src/thread_parker/unix.rs b/src/thread_parker/unix.rs index e61ab62..a58e6ff 100644 --- a/src/thread_parker/unix.rs +++ b/src/thread_parker/unix.rs @@ -11,11 +11,9 @@ use core::{ cell::{Cell, UnsafeCell}, mem::MaybeUninit, }; +use instant::Instant; use libc; -use std::{ - thread, - time::{Duration, Instant}, -}; +use std::{thread, time::Duration}; // x32 Linux uses a non-standard type for tv_nsec in timespec. // See https://sourceware.org/bugzilla/show_bug.cgi?id=16437 diff --git a/src/thread_parker/wasm.rs b/src/thread_parker/wasm.rs index f91a218..ba4118c 100644 --- a/src/thread_parker/wasm.rs +++ b/src/thread_parker/wasm.rs @@ -8,7 +8,8 @@ //! The wasm platform can't park when atomic support is not available. //! So this ThreadParker just panics on any attempt to park. -use std::{thread, time::Instant}; +use instant::Instant; +use std::thread; pub struct ThreadParker(()); diff --git a/src/thread_parker/wasm_atomic.rs b/src/thread_parker/wasm_atomic.rs index 37f3027..e482c6b 100644 --- a/src/thread_parker/wasm_atomic.rs +++ b/src/thread_parker/wasm_atomic.rs @@ -9,7 +9,8 @@ use core::{ arch::wasm32, sync::atomic::{AtomicI32, Ordering}, }; -use std::{convert::TryFrom, thread, time::Instant}; +use instant::Instant; +use std::{convert::TryFrom, thread}; // Helper type for putting a thread to sleep until some other thread wakes it up pub struct ThreadParker { diff --git a/src/thread_parker/windows/keyed_event.rs b/src/thread_parker/windows/keyed_event.rs index 7b516fe..7c37153 100644 --- a/src/thread_parker/windows/keyed_event.rs +++ b/src/thread_parker/windows/keyed_event.rs @@ -9,10 +9,8 @@ use core::{ mem::{self, MaybeUninit}, ptr, }; -use std::{ - sync::atomic::{AtomicUsize, Ordering}, - time::Instant, -}; +use instant::Instant; +use std::sync::atomic::{AtomicUsize, Ordering}; use winapi::{ shared::{ minwindef::{TRUE, ULONG}, diff --git a/src/thread_parker/windows/mod.rs b/src/thread_parker/windows/mod.rs index 9db1652..76dbb5d 100644 --- a/src/thread_parker/windows/mod.rs +++ b/src/thread_parker/windows/mod.rs @@ -9,7 +9,7 @@ use core::{ ptr, sync::atomic::{AtomicPtr, AtomicUsize, Ordering}, }; -use std::time::Instant; +use instant::Instant; mod keyed_event; mod waitaddress; diff --git a/src/thread_parker/windows/waitaddress.rs b/src/thread_parker/windows/waitaddress.rs index 0ec7804..862c5c6 100644 --- a/src/thread_parker/windows/waitaddress.rs +++ b/src/thread_parker/windows/waitaddress.rs @@ -9,7 +9,7 @@ use core::{ mem, sync::atomic::{AtomicUsize, Ordering}, }; -use std::time::Instant; +use instant::Instant; use winapi::{ shared::{ basetsd::SIZE_T, |