commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
b1adaefb273d0c8a2e144abf67c05708777dda88 | Sola | 2025-08-05T02:57:15 | Fix PthreadRwLock calling the wrong function for read lock | diff --git a/benchmark/src/rwlock.rs b/benchmark/src/rwlock.rs
index 36fa7e8..bb58fa9 100644
--- a/benchmark/src/rwlock.rs
+++ b/benchmark/src/rwlock.rs
@@ -164,7 +164,7 @@ impl<T> RwLock<T> for PthreadRwLock<T> {
F: FnOnce(&T) -> R,
{
unsafe {
- libc::pthread_rwlock_wrlock(self.1.get(... | 1 | 1 | 1 |
315be2955d86d1dbdb18801c8afcadd693288242 | Shaun Beautement | 2025-07-25T19:01:38 | place `#[track_caller]` on all wrapper functions | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index fb5b2c4..348507d 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -234,6 +234,7 @@ impl<R: RawMutex, T: ?Sized> Mutex<R, T> {
///
/// This function does not block.
#[inline]
+ #[track_caller]
pub fn try_lock(&self) ... | 3 | 124 | 0 |
e50baacc784b571c4da0f8c1553d93d867f72b6b | Expyron | 2025-07-11T14:52:59 | Replace `thread-id` with `std::thread::ThreadId` | diff --git a/core/Cargo.toml b/core/Cargo.toml
index b7f0f58..c243fea 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -17,7 +17,6 @@ rustdoc-args = ["--generate-link-to-definition"]
cfg-if = "1.0.0"
smallvec = "1.6.1"
petgraph = { version = "0.6.0", optional = true }
-thread-id = { version = "4.0.0", optional ... | 2 | 6 | 7 |
9c3b277260623d6ab4b5181dafae102d0531fb10 | Naveen Kumar G N | 2025-07-04T19:13:56 | Correct timeout_nanos calculation in SGX ThreadParker.park_until | diff --git a/core/src/thread_parker/sgx.rs b/core/src/thread_parker/sgx.rs
index b749445..7efaefc 100644
--- a/core/src/thread_parker/sgx.rs
+++ b/core/src/thread_parker/sgx.rs
@@ -59,19 +59,17 @@ impl super::ThreadParkerT for ThreadParker {
#[inline]
unsafe fn park_until(&self, timeout: Instant) -> bool {
... | 1 | 4 | 6 |
61329f4d281aa58f71677b3612693f71a29cbe30 | n7377747 | 2025-06-30T17:45:05 | Check for timedout before returning false | diff --git a/core/src/thread_parker/sgx.rs b/core/src/thread_parker/sgx.rs
index df479de..b749445 100644
--- a/core/src/thread_parker/sgx.rs
+++ b/core/src/thread_parker/sgx.rs
@@ -59,17 +59,21 @@ impl super::ThreadParkerT for ThreadParker {
#[inline]
unsafe fn park_until(&self, timeout: Instant) -> bool {
... | 1 | 12 | 8 |
f7d546b9504af06440b18e801c3601fa2bb89158 | n7377747 | 2025-06-30T14:24:25 | Fix EV_UNPARK could come from sources other than parking_lot. | diff --git a/core/src/thread_parker/sgx.rs b/core/src/thread_parker/sgx.rs
index bc0111b..df479de 100644
--- a/core/src/thread_parker/sgx.rs
+++ b/core/src/thread_parker/sgx.rs
@@ -59,13 +59,18 @@ impl super::ThreadParkerT for ThreadParker {
#[inline]
unsafe fn park_until(&self, timeout: Instant) -> bool {
... | 1 | 12 | 7 |
d854c468000e51e7f352ca97d0fb5ba9ee12d6f9 | n7377747 | 2025-06-25T03:45:47 | Adding SGX implementation for ThreadParker.park_until | diff --git a/core/src/thread_parker/sgx.rs b/core/src/thread_parker/sgx.rs
index bc76fe7..bc0111b 100644
--- a/core/src/thread_parker/sgx.rs
+++ b/core/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 s... | 1 | 11 | 3 |
f10e16873e059dc02110d56d7a48b64cfe57f15a | Alexander Schütz | 2025-06-24T21:49:48 | implement try_map variant function that can return an arbitrary value as err.
see github issue 476 | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index ed83f9c..94d6dc7 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -553,6 +553,37 @@ impl<'a, R: RawMutex + 'a, T: ?Sized + 'a> MutexGuard<'a, R, T> {
})
}
+ /// Attempts to make a new `MappedMutexGuard` for a component ... | 4 | 323 | 1 |
69c1747db22cdf3c43007a3aee5a69a893bb6088 | leopardracer | 2025-06-16T13:14:40 | Update build.rs | diff --git a/core/build.rs b/core/build.rs
index f1371cb..ce0fb8c 100644
--- a/core/build.rs
+++ b/core/build.rs
@@ -4,8 +4,8 @@
fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rustc-check-cfg=cfg(tsan_enabled)");
- let santizer_list = std::env::var("CARGO_CFG_SANITIZE").unwrap_or... | 1 | 2 | 2 |
4bb74c99169e00fdd045a68f4d89e03fb2f06c1f | Paolo Barbolini | 2025-06-14T22:57:33 | lock_api: drop build script and `autocfg` dependency | diff --git a/lock_api/Cargo.toml b/lock_api/Cargo.toml
index fb8a603..21e83db 100644
--- a/lock_api/Cargo.toml
+++ b/lock_api/Cargo.toml
@@ -23,9 +23,6 @@ owning_ref = { version = "0.4.1", optional = true }
# support, just pass "--features serde" when building this crate.
serde = { version = "1.0.126", default-featur... | 5 | 0 | 50 |
63cb903682d16b352622eb5ac12ac5185cd68d37 | Orson Peters | 2025-06-10T17:22:17 | Add missing into_arc implementations | diff --git a/lock_api/src/rwlock.rs b/lock_api/src/rwlock.rs
index 3fd3849..5997e43 100644
--- a/lock_api/src/rwlock.rs
+++ b/lock_api/src/rwlock.rs
@@ -1766,6 +1766,17 @@ impl<R: RawRwLock, T: ?Sized> ArcRwLockWriteGuard<R, T> {
&s.rwlock
}
+ /// Unlocks the `RwLock` and returns the `Arc` that was h... | 1 | 40 | 10 |
513af3fb9e7f6c4524c204b11a3c444ea6bad215 | Orson Peters | 2025-06-10T17:10:14 | Add missing into_arc(_fair) methods | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index 0917702..8747beb 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -722,13 +722,12 @@ impl<R: RawMutex, T: ?Sized> ArcMutexGuard<R, T> {
/// Unlocks the mutex and returns the `Arc` that was held by the [`ArcMutexGuard`].
#[inline... | 4 | 57 | 21 |
da06008f8b28fefa612475d8e34503a5bf47791c | Orson Peters | 2025-06-10T16:26:29 | Fix RawRwLock::bump_*() not releasing lock when there are multiple readers | diff --git a/src/raw_rwlock.rs b/src/raw_rwlock.rs
index c0455e7..2f3b588 100644
--- a/src/raw_rwlock.rs
+++ b/src/raw_rwlock.rs
@@ -173,9 +173,7 @@ unsafe impl lock_api::RawRwLockFair for RawRwLock {
#[inline]
unsafe fn bump_shared(&self) {
- if self.state.load(Ordering::Relaxed) & (READERS_MASK | W... | 1 | 2 | 4 |
249cb2a2aa3db35fe03303b989f8b9d9feba89d4 | Amanieu d'Antras | 2025-05-25T00:07:57 | Fix parked upgraders potentially not being woken up after a write lock
times out. | diff --git a/src/raw_rwlock.rs b/src/raw_rwlock.rs
index a65a36a..c0455e7 100644
--- a/src/raw_rwlock.rs
+++ b/src/raw_rwlock.rs
@@ -1055,7 +1055,7 @@ impl RawRwLock {
};
// SAFETY: `callback` does not panic or call any function of `parking_lot`.
... | 1 | 1 | 1 |
a0d2de0b019fb6e16e74f5052cb0106aabf3fa28 | Amanieu d'Antras | 2025-05-24T23:58:14 | Fix clearing `PARKED_WRITER_BIT` after a timeout
This needs to be done while holding the queue lock to avoid missed
wakeups when a concurrent unlock clears this bit.
Fixes #465 | diff --git a/src/raw_rwlock.rs b/src/raw_rwlock.rs
index 599889b..a65a36a 100644
--- a/src/raw_rwlock.rs
+++ b/src/raw_rwlock.rs
@@ -1008,7 +1008,12 @@ impl RawRwLock {
state & READERS_MASK != 0 && state & WRITER_PARKED_BIT != 0
};
let before_sleep = || {};
- let ti... | 1 | 9 | 5 |
8c36d8c185426d07423808226da5bbdaea9274c3 | Geoffry Song | 2025-03-14T03:03:58 | Use Release/Acquire ordering in thread_parker::windows::Backend::create | diff --git a/core/src/thread_parker/windows/mod.rs b/core/src/thread_parker/windows/mod.rs
index 27028a1..640012b 100644
--- a/core/src/thread_parker/windows/mod.rs
+++ b/core/src/thread_parker/windows/mod.rs
@@ -55,7 +55,7 @@ impl Backend {
ptr::null_mut(),
backend_ptr,
Ordering:... | 1 | 1 | 1 |
a4b8adc6b2dbc6c27d8101b49de4b0d56df1b8dd | Shaun Beautement | 2025-01-10T11:51:52 | add #[track_caller] where locking implementations could feasibly need to panic | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index 0917702..fb5b2c4 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -219,6 +219,7 @@ impl<R: RawMutex, T: ?Sized> Mutex<R, T> {
/// Attempts to lock a mutex in the thread which already holds the lock will
/// result in a deadlock.... | 2 | 4 | 0 |
be5489c003d1fe8f3efe701efffe357aae1b1f10 | Andrey Turkin | 2024-06-29T20:05:59 | Remove warnings due to new lint on unknown cfgs | diff --git a/core/build.rs b/core/build.rs
index d29c769..f1371cb 100644
--- a/core/build.rs
+++ b/core/build.rs
@@ -3,6 +3,7 @@
// scripts gets `cfg` info, even if the cfg is unstable.
fn main() {
println!("cargo:rerun-if-changed=build.rs");
+ println!("cargo:rustc-check-cfg=cfg(tsan_enabled)");
let san... | 4 | 5 | 1 |
c357017decfa0f21ca597a4958745ad0999cf9eb | Ivor Wanders | 2024-05-20T13:22:18 | Export types provided by arc_lock feature.
This adds conditional re-exports of the Arc-related types from the lock_api crate. | diff --git a/src/lib.rs b/src/lib.rs
index 03639a6..bc6531b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -54,3 +54,6 @@ pub use self::rwlock::{
RwLockUpgradableReadGuard, RwLockWriteGuard,
};
pub use ::lock_api;
+
+#[cfg(feature = "arc_lock")]
+pub use self::lock_api::{ArcMutexGuard, ArcReentrantMutexGuard, ArcRw... | 1 | 3 | 0 |
9ee3a5461299b904c5707c27988ddcf92d642c04 | Davide Rizzo | 2024-04-12T11:27:08 | stdarch_wasm_atomic_wait instead of stdsimd | diff --git a/core/src/lib.rs b/core/src/lib.rs
index 4845356..7376e04 100644
--- a/core/src/lib.rs
+++ b/core/src/lib.rs
@@ -49,7 +49,7 @@
target_family = "wasm",
target_feature = "atomics"
),
- feature(stdsimd)
+ feature(stdarch_wasm_atomic_wait)
)]
mod parking_lot; | 1 | 1 | 1 |
c0a9077b87bd72ea99600ba8c230736eefdf286e | Quentin Perez | 2024-04-06T13:03:32 | Add Apple visionOS support | diff --git a/core/src/thread_parker/unix.rs b/core/src/thread_parker/unix.rs
index 329cddc..5953cf3 100644
--- a/core/src/thread_parker/unix.rs
+++ b/core/src/thread_parker/unix.rs
@@ -5,12 +5,7 @@
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except ... | 1 | 5 | 34 |
75a97b267081cffca4b00aa476711314d1adbdf2 | Alex Gaynor | 2024-03-19T11:17:30 | Update redox_syscall dependency version | diff --git a/core/Cargo.toml b/core/Cargo.toml
index 31ac4df..28e8ed2 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -24,7 +24,7 @@ backtrace = { version = "0.3.60", optional = true }
libc = "0.2.95"
[target.'cfg(target_os = "redox")'.dependencies]
-redox_syscall = "0.4"
+redox_syscall = "0.5"
[target.'cf... | 1 | 1 | 1 |
1bb45aaac4c13269606fc9fe170ea580b36d797b | Peter Zhang | 2024-02-28T18:14:47 | Fix panic when calling `with_upgraded` twice on a `ArcRwLockUpgradableReadGuard`
Fixes #430 | diff --git a/lock_api/src/rwlock.rs b/lock_api/src/rwlock.rs
index 67790b6..269d099 100644
--- a/lock_api/src/rwlock.rs
+++ b/lock_api/src/rwlock.rs
@@ -2168,7 +2168,7 @@ impl<'a, R: RawRwLockUpgradeTimed + RawRwLockUpgradeDowngrade + 'a, T: ?Sized +
if unsafe { self.rwlock.raw.try_upgrade_for(timeout) } {
... | 2 | 24 | 6 |
5de2398109eb737680a4f733e6b4162b3abbe686 | Bruce Mitchener | 2024-02-28T16:46:42 | Fix typos. | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index ea4b142..0917702 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -349,7 +349,7 @@ impl<R: RawMutex, T: ?Sized> Mutex<R, T> {
}
impl<R: RawMutexFair, T: ?Sized> Mutex<R, T> {
- /// Forcibly unlocks the mutex using a fair unlock pro... | 2 | 3 | 3 |
8c7aef2044aaee480d1009413c2bb2d405f90160 | Nick Spinale | 2024-01-26T10:54:00 | Add lock_api::*::from_raw methods
Adds from_raw methods for lock_api::{Mutex, ReentrantMutex, RwLock}.
These have the same behavior as the existing legacy const_new methods. | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index 8f11e74..ea4b142 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -173,15 +173,23 @@ impl<R: RawMutex, T> Mutex<R, T> {
impl<R, T> Mutex<R, T> {
/// Creates a new mutex based on a pre-existing raw mutex.
- ///
- /// This all... | 3 | 37 | 11 |
279535593f187a5a1b872e662e4aae1a5c9198b8 | Liu Dingming | 2023-12-04T12:44:27 | Make Debug implementation for Rwlock simpler | diff --git a/lock_api/src/rwlock.rs b/lock_api/src/rwlock.rs
index 5c8baf3..e9c6e99 100644
--- a/lock_api/src/rwlock.rs
+++ b/lock_api/src/rwlock.rs
@@ -1198,21 +1198,15 @@ impl<R: RawRwLock, T> From<T> for RwLock<R, T> {
impl<R: RawRwLock, T: ?Sized + fmt::Debug> fmt::Debug for RwLock<R, T> {
fn fmt(&self, f: ... | 1 | 6 | 12 |
0bdc7876a546faa96e0e676427b1a87231d7afeb | Sky | 2023-11-22T05:21:33 | Enable some features for the playground
This will enable some features (`arc_lock`, `serde`, and `deadlock_detection`) on the playground (https://play.rust-lang.org). Feature list was copied from `package.metadata.docs.rs`, feel free to change if it isn't right.
See https://github.com/rust-lang/rust-playground/issu... | diff --git a/Cargo.toml b/Cargo.toml
index ace6cdc..bc41f36 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,6 +15,9 @@ rust-version = "1.49"
features = ["arc_lock", "serde", "deadlock_detection"]
rustdoc-args = ["--generate-link-to-definition"]
+[package.metadata.playground]
+features = ["arc_lock", "serde", "deadl... | 1 | 3 | 0 |
c950c987f2f2fcd4ee916dfe06195587dd6eaba2 | Bruce Mitchener | 2023-10-22T05:25:17 | hardware-lock-elision: Remove redundant import.
Each function which uses `asm!` is already importing `core::arch::asm`
on its own. | diff --git a/src/elision.rs b/src/elision.rs
index 3dbe938..a4e2e57 100644
--- a/src/elision.rs
+++ b/src/elision.rs
@@ -5,11 +5,6 @@
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.
-#[cfg(all(
- feature = "hardware... | 1 | 0 | 5 |
1d6f1fb0b97745b357312af69f28017ae787087b | Bruce Mitchener | 2023-10-22T04:55:04 | docs: Include some features when building for docs.rs.
Fixes #395. | diff --git a/Cargo.toml b/Cargo.toml
index dc62068..ace6cdc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,6 +12,7 @@ edition = "2018"
rust-version = "1.49"
[package.metadata.docs.rs]
+features = ["arc_lock", "serde", "deadlock_detection"]
rustdoc-args = ["--generate-link-to-definition"]
[dependencies] | 1 | 1 | 0 |
3b60799d81b9d2c9ae6890e93b84a3b8af472e6f | Bruce Mitchener | 2023-10-22T04:51:15 | Markdown fixes / improvements.
This fixes missing backticks, imbalanced backticks, old HTML
intradoc links, and adds a couple of links. | diff --git a/core/src/parking_lot.rs b/core/src/parking_lot.rs
index d74b439..2eabf69 100644
--- a/core/src/parking_lot.rs
+++ b/core/src/parking_lot.rs
@@ -1103,7 +1103,7 @@ pub mod deadlock {
pub(super) use super::deadlock_impl::DeadlockData;
/// Acquire a resource identified by key in the deadlock detect... | 10 | 29 | 36 |
d4e7a531bf25f71f731e77911bf1eff94e26ce77 | Bruce Mitchener | 2023-10-21T16:20:51 | Remove unnecessary single component path imports. | diff --git a/src/fair_mutex.rs b/src/fair_mutex.rs
index d7d7a77..2807af2 100644
--- a/src/fair_mutex.rs
+++ b/src/fair_mutex.rs
@@ -6,7 +6,6 @@
// copied, modified, or distributed except according to those terms.
use crate::raw_fair_mutex::RawFairMutex;
-use lock_api;
/// A mutual exclusive primitive that is al... | 3 | 0 | 3 |
3f38a9ef089b298dd297b11f6981b567b9c5310b | Lochlann Andrews | 2023-10-17T22:37:08 | rename arc guard creation methods | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index 0f4bbdb..80eadfa 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -309,7 +309,7 @@ impl<R: RawMutex, T: ?Sized> Mutex<R, T> {
/// the guard was forgotten with `mem::forget`.
#[cfg(feature = "arc_lock")]
#[inline]
- unsaf... | 3 | 38 | 30 |
aa2115faac84f84dd3e69a13ebba16fb0095b8c7 | Alex Gaynor | 2023-10-16T02:15:02 | Updated redox_syscall dep | diff --git a/core/Cargo.toml b/core/Cargo.toml
index 28588ef..384bbbc 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -24,7 +24,7 @@ backtrace = { version = "0.3.60", optional = true }
libc = "0.2.95"
[target.'cfg(target_os = "redox")'.dependencies]
-redox_syscall = "0.3"
+redox_syscall = "0.4"
[target.'cf... | 1 | 1 | 1 |
8f5ccd05538b37dcc795c8c3820255f70a3fcd6b | Lochlann Andrews | 2023-10-05T04:26:16 | small fix to doc wording on read guard methods | diff --git a/lock_api/src/rwlock.rs b/lock_api/src/rwlock.rs
index debed52..66c321c 100644
--- a/lock_api/src/rwlock.rs
+++ b/lock_api/src/rwlock.rs
@@ -416,8 +416,8 @@ impl<R: RawRwLock, T: ?Sized> RwLock<R, T> {
/// This method must only be called if the thread logically holds a read lock.
///
/// This... | 1 | 6 | 6 |
e927d19497bf783b50dcfc09a432e83309a370a2 | Lochlann Andrews | 2023-10-05T03:25:19 | Updated documentation for upgradable guard creation function. | diff --git a/lock_api/src/rwlock.rs b/lock_api/src/rwlock.rs
index ce5f09f..debed52 100644
--- a/lock_api/src/rwlock.rs
+++ b/lock_api/src/rwlock.rs
@@ -1008,11 +1008,17 @@ impl<R: RawRwLockRecursiveTimed, T: ?Sized> RwLock<R, T> {
}
impl<R: RawRwLockUpgrade, T: ?Sized> RwLock<R, T> {
+ /// Creates a new `RwLock... | 1 | 12 | 6 |
d0d4ee95e02b1c71d5a81b96890aea3535c2d3a8 | Lochlann Andrews | 2023-10-05T03:18:34 | Updated documentation for guard creation functions | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index 22c9973..0f4bbdb 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -189,13 +189,16 @@ impl<R, T> Mutex<R, T> {
}
impl<R: RawMutex, T: ?Sized> Mutex<R, T> {
+ /// Creates a new `MutexGuard` without checking if the mutex is locked.
+ ... | 3 | 98 | 64 |
32a6558ef23549a40f4023f757488be2be7a82e5 | Luis Cruz | 2023-07-10T15:38:03 | Add apple tvos support | diff --git a/core/src/thread_parker/unix.rs b/core/src/thread_parker/unix.rs
index 7f28603..fdc1ed9 100644
--- a/core/src/thread_parker/unix.rs
+++ b/core/src/thread_parker/unix.rs
@@ -5,7 +5,7 @@
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except a... | 1 | 5 | 3 |
7575c81a090d6ceceeeccbb968a388fdbbd3475b | Lochlann Andrews | 2023-10-03T04:10:33 | Fixes to documentation of guard creation functions | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index 7c15d9b..22c9973 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -192,7 +192,7 @@ impl<R: RawMutex, T: ?Sized> Mutex<R, T> {
/// # Safety
///
/// The lock must be held when calling this method. This method must only
- /... | 3 | 7 | 5 |
86b8733aca5c9a847e0d9abd0a274e513eadb310 | Lochlann Andrews | 2023-09-21T02:26:51 | Allow unsafe creation of new lock guards | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index 29533c9..7c15d9b 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -191,9 +191,11 @@ impl<R, T> Mutex<R, T> {
impl<R: RawMutex, T: ?Sized> Mutex<R, T> {
/// # Safety
///
- /// The lock must be held when calling this method.
+... | 3 | 14 | 8 |
22819d37bcda2cff109412f33066c4b5d28eef51 | Alice Ryhl | 2023-09-20T10:52:18 | Reduce repeats in unpark_all_one_fast test | diff --git a/core/src/parking_lot.rs b/core/src/parking_lot.rs
index 6153677..d74b439 100644
--- a/core/src/parking_lot.rs
+++ b/core/src/parking_lot.rs
@@ -1476,7 +1476,7 @@ mod tests {
test! {
unpark_all_one_fast(
- repeats: 10000, latches: 1, delay: 0, threads: 1, single_unparks: 0
+ ... | 1 | 1 | 1 |
0699ffa9b9c24ef5d89d4a0488a1ae760d11ea95 | Bruce Mitchener | 2023-08-09T03:47:00 | windows: impl `ThreadParkerT` / `UnparkHandleT`.
Windows was implementing the same functions directly on its
`ThreadParker` and `UnparkHandle` (but with some functions
not marked as `unsafe`).
This changes the Windows implementation to match the other platforms.
This fixes unused warnings about imports of those type... | diff --git a/core/src/thread_parker/windows/mod.rs b/core/src/thread_parker/windows/mod.rs
index 876d89d..27028a1 100644
--- a/core/src/thread_parker/windows/mod.rs
+++ b/core/src/thread_parker/windows/mod.rs
@@ -75,11 +75,13 @@ pub struct ThreadParker {
backend: &'static Backend,
}
-impl ThreadParker {
- pu... | 1 | 12 | 10 |
e5249867b4f714187e7d3041ebd9517ac50fba36 | Guillaume Gomez | 2023-07-14T15:28:08 | Add `--generate-link-to-definition` option when building on docs.rs | diff --git a/Cargo.toml b/Cargo.toml
index 90b653d..9f81d21 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,6 +10,9 @@ keywords = ["mutex", "condvar", "rwlock", "once", "thread"]
categories = ["concurrency"]
edition = "2018"
+[package.metadata.docs.rs]
+rustdoc-args = ["--generate-link-to-definition"]
+
[dependenc... | 3 | 7 | 1 |
64b711461ed528de7c05868e5024f21e602cd4e0 | Amanieu d'Antras | 2023-06-30T05:51:59 | Fix `RwLockUpgradeableReadGuard::with_upgraded`
Fixes #392 | diff --git a/lock_api/src/rwlock.rs b/lock_api/src/rwlock.rs
index cfec59e..275e637 100644
--- a/lock_api/src/rwlock.rs
+++ b/lock_api/src/rwlock.rs
@@ -2025,7 +2025,7 @@ impl<'a, R: RawRwLockUpgradeDowngrade + 'a, T: ?Sized + 'a> RwLockUpgradableRead
// Safety: We just upgraded the lock, so we have mutable ... | 2 | 17 | 2 |
92609bad2758b8d1475682a0423567245847af66 | DavisVaughan | 2023-06-23T20:25:09 | Add a test | diff --git a/src/remutex.rs b/src/remutex.rs
index 1037923..a925369 100644
--- a/src/remutex.rs
+++ b/src/remutex.rs
@@ -71,9 +71,11 @@ pub type MappedReentrantMutexGuard<'a, T> =
#[cfg(test)]
mod tests {
use crate::ReentrantMutex;
+ use crate::ReentrantMutexGuard;
use std::cell::RefCell;
use std::s... | 1 | 22 | 0 |
e23efd5fbdc9c9519000b0ec0aeb92a799e77635 | DavisVaughan | 2023-06-23T19:42:30 | Reset `lock_count` appropriately in `bump()` | diff --git a/lock_api/src/remutex.rs b/lock_api/src/remutex.rs
index a2f8185..a7146b1 100644
--- a/lock_api/src/remutex.rs
+++ b/lock_api/src/remutex.rs
@@ -183,8 +183,10 @@ impl<R: RawMutexFair, G: GetThreadId> RawReentrantMutex<R, G> {
if self.lock_count.get() == 1 {
let id = self.owner.load(Ord... | 1 | 2 | 0 |
87c80b78f198cd0b9445b51ad0c5a2c494bfa1a5 | Adrian Heine né Lang | 2023-06-12T13:28:43 | Add rust-version to core/Cargo.toml | diff --git a/core/Cargo.toml b/core/Cargo.toml
index a576a53..b6d4f46 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -8,6 +8,7 @@ repository = "https://github.com/Amanieu/parking_lot"
keywords = ["mutex", "condvar", "rwlock", "once", "thread"]
categories = ["concurrency"]
edition = "2018"
+rust-version = "1.4... | 1 | 1 | 0 |
3afcf68d0aa1e94c76b7332a22e3b07b7f178a07 | Amanieu d'Antras | 2023-06-05T18:27:50 | Fix incorrect fairness claim in `RwLockReadGuard::unlocked` docs
Fixes #381 | diff --git a/lock_api/src/rwlock.rs b/lock_api/src/rwlock.rs
index 3c1adc8..528e1f7 100644
--- a/lock_api/src/rwlock.rs
+++ b/lock_api/src/rwlock.rs
@@ -1247,8 +1247,6 @@ impl<'a, R: RawRwLock + 'a, T: ?Sized + 'a> RwLockReadGuard<'a, R, T> {
/// Temporarily unlocks the `RwLock` to execute the given function.
... | 1 | 0 | 2 |
7f83d8dd8f7c2435d1cecc3e6b3a458c2836ffea | Jules Bertholet | 2023-05-26T04:51:44 | Add `with_upgraded` API to upgradeable read locks
Allows getting an `&mut` to the data from an `&mut` to the guard. | diff --git a/lock_api/src/rwlock.rs b/lock_api/src/rwlock.rs
index baf3173..3c1adc8 100644
--- a/lock_api/src/rwlock.rs
+++ b/lock_api/src/rwlock.rs
@@ -1897,7 +1897,7 @@ impl<'a, R: RawRwLockUpgrade + 'a, T: ?Sized + 'a> RwLockUpgradableReadGuard<'a,
f()
}
- /// Atomically upgrades an upgradable rea... | 1 | 241 | 8 |
0cffece5146172fb1ec9ac6be19f67b4e0a6db10 | Jules Bertholet | 2023-05-26T05:18:03 | Fix `cargo check` warnings and run rustfmt | diff --git a/core/src/parking_lot.rs b/core/src/parking_lot.rs
index 04891b6..c189562 100644
--- a/core/src/parking_lot.rs
+++ b/core/src/parking_lot.rs
@@ -248,7 +248,7 @@ fn create_hashtable() -> &'static HashTable {
// Free the table we created
// SAFETY: `new_table` is created from `Box::i... | 2 | 2 | 1 |
09ca77377002e207e0a9f4246153a7deac182f61 | dAxpeDDa | 2023-05-15T20:15:16 | Revert #379 | diff --git a/core/Cargo.toml b/core/Cargo.toml
index 19a0d90..00c322a 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -13,14 +13,8 @@ edition = "2018"
cfg-if = "1.0.0"
smallvec = "1.6.1"
petgraph = { version = "0.6.0", optional = true }
-backtrace = { version = "0.3.60", optional = true }
-
-[target.'cfg(not(t... | 2 | 2 | 52 |
28558031591c78c055ff06ac0a453b86c9417c62 | Sam Denty | 2023-04-30T16:21:01 | feat(wasm-bindgen): deadlock detector support | diff --git a/core/Cargo.toml b/core/Cargo.toml
index 7ed5f2a..189d720 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -13,9 +13,15 @@ edition = "2018"
cfg-if = "1.0.0"
smallvec = "1.6.1"
petgraph = { version = "0.6.0", optional = true }
-thread-id = { version = "4.0.0", optional = true }
backtrace = { version... | 2 | 52 | 2 |
e95883e52b9e5c6733481033d87983849ee01c3c | rmsyn | 2023-04-24T02:26:07 | lock_api: Add default "atomic_usize" feature
Adds a default "atomic_usize" feature as a feature gate for library
components that rely on `AtomicUsize`. Some platforms, such as AVR, do
not support atomics with large widths.
Current library users will experience no changes, but users on
constrained platforms can opt-ou... | diff --git a/lock_api/Cargo.toml b/lock_api/Cargo.toml
index 65cf239..ee5e9cb 100644
--- a/lock_api/Cargo.toml
+++ b/lock_api/Cargo.toml
@@ -26,5 +26,7 @@ serde = { version = "1.0.126", default-features = false, optional = true }
autocfg = "1.1.0"
[features]
+default = ["atomic_usize"]
nightly = []
arc_lock = []
... | 2 | 4 | 0 |
7157879ab531e0fe935b5d5599c8d447fe56efc5 | Kenny Kerr | 2023-04-10T14:33:47 | windows-targets | diff --git a/core/Cargo.toml b/core/Cargo.toml
index 7ed5f2a..00c322a 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -22,6 +22,9 @@ libc = "0.2.95"
[target.'cfg(target_os = "redox")'.dependencies]
redox_syscall = "0.3"
+[target.'cfg(windows)'.dependencies]
+windows-targets = "0.48.0"
+
[features]
nightly =... | 2 | 8 | 10 |
5d2d746f0085af17dc8187aecc719310e98b7188 | circumspect | 2023-04-08T09:59:51 | docs: typo fixes | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index 4147cb3..29533c9 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -257,7 +257,7 @@ impl<R: RawMutex, T: ?Sized> Mutex<R, T> {
/// # Safety
///
/// This method must only be called if the current thread logically owns a
- ... | 1 | 2 | 2 |
8818ba2421d8e3f7a17a1d6e66047e8dbd103e87 | Konstantin Grechishchev | 2023-04-06T09:50:11 | Update redox_syscall | diff --git a/core/Cargo.toml b/core/Cargo.toml
index 61ddbf9..7ed5f2a 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -20,7 +20,7 @@ backtrace = { version = "0.3.60", optional = true }
libc = "0.2.95"
[target.'cfg(target_os = "redox")'.dependencies]
-redox_syscall = "0.2.8"
+redox_syscall = "0.3"
[features... | 1 | 1 | 1 |
d6b74d125ed2f4012cb2186e3bf2e5024bede8ff | Jake Shadle | 2023-03-20T16:07:45 | Removing trailing empty line | diff --git a/core/src/thread_parker/windows/bindings.rs b/core/src/thread_parker/windows/bindings.rs
index 730aaa8..5e1205a 100644
--- a/core/src/thread_parker/windows/bindings.rs
+++ b/core/src/thread_parker/windows/bindings.rs
@@ -34,4 +34,3 @@ extern "system" {
pub fn Sleep(dwMilliseconds: u32);
}
- | 1 | 0 | 1 |
1df5f7e1e4fe376574470e4a6b0c4e69a091a644 | Jake Shadle | 2023-03-20T16:06:01 | Remove pointless casting | diff --git a/core/src/thread_parker/windows/bindings.rs b/core/src/thread_parker/windows/bindings.rs
index 6bfd8a8..730aaa8 100644
--- a/core/src/thread_parker/windows/bindings.rs
+++ b/core/src/thread_parker/windows/bindings.rs
@@ -7,8 +7,8 @@ pub const INFINITE: u32 = 4294967295;
pub const ERROR_TIMEOUT: u32 = 1460;... | 1 | 2 | 2 |
53081fa6d9201a06ec948f0ab799eee8fd5a7074 | Jake Shadle | 2023-03-20T16:01:03 | Add comment detailing the reasoning for manual bindings | diff --git a/core/src/thread_parker/windows/bindings.rs b/core/src/thread_parker/windows/bindings.rs
index 996eb4e..6bfd8a8 100644
--- a/core/src/thread_parker/windows/bindings.rs
+++ b/core/src/thread_parker/windows/bindings.rs
@@ -1,3 +1,8 @@
+//! Manual bindings to the win32 API to avoid dependencies on windows-sys ... | 1 | 5 | 0 |
aa6d23ca4a5bb15fc8611f9a132c79d3dd0963da | Jake Shadle | 2023-03-20T14:46:12 | Remove windows-sys dependency | diff --git a/core/Cargo.toml b/core/Cargo.toml
index c1fd530..61ddbf9 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -22,14 +22,6 @@ libc = "0.2.95"
[target.'cfg(target_os = "redox")'.dependencies]
redox_syscall = "0.2.8"
-[target.'cfg(windows)'.dependencies]
-windows-sys = { version = "0.45.0", features = [... | 5 | 49 | 57 |
4cd9cf66f087dde975304efdfd89ff1771039751 | Martin Kröning | 2023-03-07T13:13:44 | lock_api: Enable doc_auto_cfg on docs.rs
This enables all features to be activated for docs.rs with automated annotations if types or functions are feature-gated.
You can preview this locally by running
```
RUSTDOCFLAGS="--cfg=docsrs" cargo +nightly doc --all-features --open
``` | diff --git a/lock_api/Cargo.toml b/lock_api/Cargo.toml
index c21bd8a..65cf239 100644
--- a/lock_api/Cargo.toml
+++ b/lock_api/Cargo.toml
@@ -9,6 +9,10 @@ keywords = ["mutex", "rwlock", "lock", "no_std"]
categories = ["concurrency", "no-std"]
edition = "2018"
+[package.metadata.docs.rs]
+all-features = true
+rustdoc... | 2 | 5 | 0 |
a87498c00d9e552537ea77f20b72adafabbafde3 | Martin Kröning | 2023-03-07T12:12:08 | Mark all guards as clippy::has_significant_drop | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index a302c87..4147cb3 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -679,6 +679,7 @@ unsafe impl<'a, R: RawMutex + 'a, T: ?Sized + 'a> StableAddress for MutexGuard<'
/// This is similar to the `MutexGuard` struct, except instead of using a... | 3 | 13 | 0 |
c5c8126f0a98614ed427d2a4aff8542269b652dc | Benoît du Garreau | 2023-03-03T15:54:21 | Make `RwLock` guards `Sync` again | diff --git a/lock_api/src/rwlock.rs b/lock_api/src/rwlock.rs
index c972fb6..916c39a 100644
--- a/lock_api/src/rwlock.rs
+++ b/lock_api/src/rwlock.rs
@@ -1188,6 +1188,8 @@ pub struct RwLockReadGuard<'a, R: RawRwLock, T: ?Sized> {
marker: PhantomData<(&'a T, R::GuardMarker)>,
}
+unsafe impl<R: RawRwLock + Sync, T... | 1 | 4 | 0 |
b52ce42fa9f062ada6124e87622c0e3977c822c4 | Caio | 2023-02-03T21:31:06 | Bad character | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index 75ecf5a..a302c87 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -485,7 +485,7 @@ where
///
/// The data protected by the mutex can be accessed through this guard via its
/// `Deref` and `DerefMut` implementations.
-#[clippy::has_sign... | 1 | 1 | 1 |
59dfa3dfe9fe531f47655b6a77d9032f3120a09f | Caio | 2023-02-02T14:24:48 | Mark `MutexGuard` with `#[clippy::has_significant_drop]`
`#[clippy::has_significant_drop]` tells that a structure should be considered when evaluating some lints. Examples of such behavior are the existent `clippy::significant_drop_in_scrutinee` and in the soon-to-be-finished https://github.com/rust-lang/rust-clippy/i... | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index c97e543..75ecf5a 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -485,6 +485,7 @@ where
///
/// The data protected by the mutex can be accessed through this guard via its
/// `Deref` and `DerefMut` implementations.
+#[clippy::has_sign... | 1 | 1 | 0 |
cc5173e0b09b31741a8ccfab71f22aa31c3d2b90 | Taiki Endo | 2023-01-21T01:31:19 | Update windows-sys to 0.45 | diff --git a/core/Cargo.toml b/core/Cargo.toml
index 494eb68..aefd8e0 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -23,7 +23,7 @@ libc = "0.2.95"
redox_syscall = "0.2.8"
[target.'cfg(windows)'.dependencies]
-windows-sys = { version = "0.42.0", features = [
+windows-sys = { version = "0.45.0", features = [
... | 1 | 1 | 1 |
d0cb97cf8b6c872a1c7f47b7b295ab604e1f9184 | Doug | 2023-01-04T17:56:57 | Add support for watchOS.
Mirrors macOS and iOS. | diff --git a/core/src/thread_parker/unix.rs b/core/src/thread_parker/unix.rs
index 88b6df8..7f28603 100644
--- a/core/src/thread_parker/unix.rs
+++ b/core/src/thread_parker/unix.rs
@@ -5,7 +5,7 @@
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except a... | 1 | 5 | 3 |
246ec6d0e063753dcb36ce365cf5dfd072fb0b5d | Wesley Wiser | 2022-11-22T23:28:26 | Update use of `libc::timespec` to prepare for future libc version
In a future release of the `libc` crate, `libc::timespec` will contain
private padding fields on `*-linux-musl` targets and so the struct will
no longer be able to be created using the literal initialization syntax.
Update the use of `libc::timespec` t... | diff --git a/core/src/thread_parker/linux.rs b/core/src/thread_parker/linux.rs
index 5d4e229..92601f6 100644
--- a/core/src/thread_parker/linux.rs
+++ b/core/src/thread_parker/linux.rs
@@ -80,10 +80,10 @@ impl super::ThreadParkerT for ThreadParker {
self.park();
return true;
... | 1 | 4 | 4 |
5c3884785b9ba01b4d1397274561bbee2d1ba14d | Benoît du Garreau | 2022-10-03T08:28:59 | Update `windows-sys` to `0.42` | diff --git a/core/Cargo.toml b/core/Cargo.toml
index cb8b004..dd0e38f 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -23,7 +23,7 @@ libc = "0.2.95"
redox_syscall = "0.2.8"
[target.'cfg(windows)'.dependencies]
-windows-sys = { version = "0.36.0", features = [
+windows-sys = { version = "0.42.0", features = [
... | 1 | 1 | 1 |
584a9167b84f9d2ee4c51d13196b8b78dc142058 | Amanieu d'Antras | 2022-09-20T13:56:20 | cargo fmt | diff --git a/core/src/thread_parker/generic.rs b/core/src/thread_parker/generic.rs
index 990bcb7..93c94fa 100644
--- a/core/src/thread_parker/generic.rs
+++ b/core/src/thread_parker/generic.rs
@@ -8,8 +8,8 @@
//! A simple spin lock based thread parker. Used on platforms without better
//! parking facilities available... | 6 | 195 | 178 |
b9612b3d0b3bdc997c0bbd4b4b0c513be8dcf60b | Amanieu d'Antras | 2022-09-20T13:55:05 | Fix typos in try_map documentation | diff --git a/lock_api/src/remutex.rs b/lock_api/src/remutex.rs
index c450798..3e2010f 100644
--- a/lock_api/src/remutex.rs
+++ b/lock_api/src/remutex.rs
@@ -646,7 +646,7 @@ impl<'a, R: RawMutex + 'a, G: GetThreadId + 'a, T: ?Sized + 'a> ReentrantMutexGu
/// in already locked the mutex.
///
/// This is an... | 2 | 5 | 5 |
844be5eaa116820b14642b0893c288ba13a99e7f | Amanieu d'Antras | 2022-09-20T07:12:39 | Fix `ReentrantMutexGuard::try_map` signature
This previously incorrectly used `&mut T` instead of `&T`.
Fixes #354 | diff --git a/lock_api/src/remutex.rs b/lock_api/src/remutex.rs
index fa0e934..c450798 100644
--- a/lock_api/src/remutex.rs
+++ b/lock_api/src/remutex.rs
@@ -654,10 +654,10 @@ impl<'a, R: RawMutex + 'a, G: GetThreadId + 'a, T: ?Sized + 'a> ReentrantMutexGu
f: F,
) -> Result<MappedReentrantMutexGuard<'a, R,... | 1 | 2 | 2 |
ba57312f5bbcc4f83d520a8fb963a25edffceba3 | Mahmoud Al-Qudsi | 2022-09-02T18:52:23 | Document async signal safety of unpark methods
Safety disclaimer is only added to the unpark methods, as those are the only
ones that one might sanely wish to call from an async context. | diff --git a/core/src/parking_lot.rs b/core/src/parking_lot.rs
index 9b84525..b388619 100644
--- a/core/src/parking_lot.rs
+++ b/core/src/parking_lot.rs
@@ -724,6 +724,10 @@ pub unsafe fn park(
///
/// The `callback` function is called while the queue is locked and must not
/// panic or call into any function in `pa... | 1 | 8 | 0 |
c9711fa2558ce06229d01cb75b5ac80374cb7d7c | Amanieu d'Antras | 2022-08-28T08:13:21 | Don't accept `self` in ArcMutexGuard methods | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index bf64eba..c97e543 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -699,16 +699,16 @@ unsafe impl<R: RawMutex + Sync, T: Sync + ?Sized> Sync for ArcMutexGuard<R, T> w
impl<R: RawMutex, T: ?Sized> ArcMutexGuard<R, T> {
/// Returns a r... | 1 | 5 | 5 |
90e789672f1e3140e96413e4815b354190a8d7e4 | Amanieu d'Antras | 2022-08-28T00:06:52 | Add `ArcMutexGuard::into_arc`
This allows the contained `Arc` to be recovered after unlocking the
mutex. | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index 4e1b879..4982503 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -692,6 +692,18 @@ impl<R: RawMutex, T: ?Sized> ArcMutexGuard<R, T> {
&self.mutex
}
+ /// Unlocks the mutex and returns the `Arc` that was held by the [`A... | 1 | 12 | 0 |
d435120052d9a36757cfc15f3b29f1ff71a3feac | jtnunley | 2022-08-26T16:55:10 | Fix cfg bounds | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index 6d2e8a4..9555d55 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -684,10 +684,12 @@ pub struct ArcMutexGuard<R: RawMutex, T: ?Sized> {
marker: PhantomData<*const ()>,
}
-unsafe impl<R: RawMutex + Send + Sync, T: Send + Sync + ?Si... | 1 | 3 | 1 |
9c7c85c4c0258ee18ccbe3da98880858329eb1f3 | jtnunley | 2022-08-23T20:51:30 | Fix bounds | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index a6be63b..6d2e8a4 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -681,16 +681,14 @@ unsafe impl<'a, R: RawMutex + 'a, T: ?Sized + 'a> StableAddress for MutexGuard<'
#[must_use = "if unused the Mutex will immediately unlock"]
pub struct... | 1 | 3 | 5 |
0d759b545e11e01ddbd29e635631568078c6070d | jtnunley | 2022-08-18T16:27:14 | fix arcmutexguard soundness | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index 4e1b879..a6be63b 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -681,7 +681,18 @@ unsafe impl<'a, R: RawMutex + 'a, T: ?Sized + 'a> StableAddress for MutexGuard<'
#[must_use = "if unused the Mutex will immediately unlock"]
pub struct ... | 1 | 12 | 1 |
7f147e574a140afe389a420b21bae8da99ac4e4a | Claudia Pellegrino | 2022-08-18T07:57:34 | Add MSRV to Cargo.toml
Add a `rust_version` entry to `Cargo.toml` in order to codify the MSRV
for `cargo` to pick it up. This leads to a more helpful and more
actionable error message, for example:
> error: package `parking_lot v0.12.1 ([…])` cannot be built because
> it requires rustc 1.59 or newer, while the curren... | diff --git a/Cargo.toml b/Cargo.toml
index 90b653d..997fe87 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,6 +9,7 @@ readme = "README.md"
keywords = ["mutex", "condvar", "rwlock", "once", "thread"]
categories = ["concurrency"]
edition = "2018"
+rust-version = "1.49"
[dependencies]
parking_lot_core = { path = "co... | 1 | 1 | 0 |
ef12b00daf0dbc6dd025098ec2cd0517bb9f737c | Bryan Hitchcock | 2022-05-31T00:24:09 | small test update | diff --git a/src/condvar.rs b/src/condvar.rs
index debeb08..15daa69 100644
--- a/src/condvar.rs
+++ b/src/condvar.rs
@@ -757,7 +757,7 @@ mod tests {
let mutex = Arc::new(Mutex::new(0));
let cv = Arc::new(Condvar::new());
- let num_iters = u32::MAX;
+ let num_iters = 3;
let con... | 1 | 2 | 4 |
fdb063cd4e33d9c44cc08aea0c341ffec7e7b282 | Bryan Hitchcock | 2022-05-31T00:21:13 | wait_while can't timeout fix | diff --git a/src/condvar.rs b/src/condvar.rs
index 069f2b5..debeb08 100644
--- a/src/condvar.rs
+++ b/src/condvar.rs
@@ -422,16 +422,12 @@ impl Condvar {
/// This function will panic if another thread is waiting on the `Condvar`
/// with a different `Mutex` object.
#[inline]
- pub fn wait_while<T, F>(... | 1 | 3 | 7 |
26e19dced4ae01000abc0dfca251f56695b1b8aa | Bryan Hitchcock | 2022-05-31T00:13:06 | Remove WaitWhileResult | diff --git a/src/condvar.rs b/src/condvar.rs
index 5d0b893..069f2b5 100644
--- a/src/condvar.rs
+++ b/src/condvar.rs
@@ -30,17 +30,6 @@ impl WaitTimeoutResult {
}
}
-/// A type indicating how many times a thread was blocked during wait_while.
-#[derive(Debug, PartialEq, Eq, Copy, Clone)]
-pub struct WaitWhileRe... | 1 | 28 | 37 |
d26c284fe8413bdeeed3ef4f70e23b5919a9ffeb | Amanieu d'Antras | 2022-05-30T23:48:05 | Fix incorrect memory ordering in RwLock
Fixes #323 | diff --git a/src/raw_rwlock.rs b/src/raw_rwlock.rs
index 21d338b..6d1fef9 100644
--- a/src/raw_rwlock.rs
+++ b/src/raw_rwlock.rs
@@ -988,8 +988,8 @@ impl RawRwLock {
if let Err(x) = self.state.compare_exchange_weak(
state,
state | WRITER_PARKED_BIT,
- ... | 1 | 2 | 2 |
045828381a5facff71b1aad3c01af15801959458 | Bryan Hitchcock | 2022-05-29T20:21:56 | Use saturating_add for WaitWhileResult | diff --git a/src/condvar.rs b/src/condvar.rs
index bbe7f53..5d0b893 100644
--- a/src/condvar.rs
+++ b/src/condvar.rs
@@ -411,7 +411,7 @@ impl Condvar {
let mut timeout_result = WaitTimeoutResult(false);
while !timeout_result.timed_out() && condition(mutex_guard.deref_mut()) {
- result.0 +... | 1 | 1 | 1 |
686db4755913947219f83a04b21885032685d246 | Bryan Hitchcock | 2022-05-29T19:26:12 | Add Condvar::wait_while convenience methods | diff --git a/src/condvar.rs b/src/condvar.rs
index 46a5d44..bbe7f53 100644
--- a/src/condvar.rs
+++ b/src/condvar.rs
@@ -14,6 +14,7 @@ use core::{
};
use lock_api::RawMutex as RawMutex_;
use parking_lot_core::{self, ParkResult, RequeueOp, UnparkResult, DEFAULT_PARK_TOKEN};
+use std::ops::DerefMut;
use std::time::{D... | 1 | 249 | 0 |
d64f3a5a78dac9dc097496d139872c860558ed89 | Marijn Suijten | 2022-05-28T18:08:11 | lock_api/rwlock: Appropriately mention `try_map` instead of `map` in `try_map` docs | diff --git a/lock_api/src/rwlock.rs b/lock_api/src/rwlock.rs
index e947f1e..264b94b 100644
--- a/lock_api/src/rwlock.rs
+++ b/lock_api/src/rwlock.rs
@@ -1218,13 +1218,13 @@ impl<'a, R: RawRwLock + 'a, T: ?Sized + 'a> RwLockReadGuard<'a, R, T> {
}
/// Attempts to make a new `MappedRwLockReadGuard` for a com... | 1 | 2 | 2 |
e6129be275833410a1ae81b0319ae44683ccade1 | Alexis (Poliorcetics) Bourget | 2022-04-27T14:10:21 | deps: update to windows-sys 0.36 | diff --git a/core/Cargo.toml b/core/Cargo.toml
index 0a993c2..e484bcc 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -23,7 +23,7 @@ libc = "0.2.95"
redox_syscall = "0.2.8"
[target.'cfg(windows)'.dependencies]
-windows-sys = { version = "0.34.0", features = [
+windows-sys = { version = "0.36.0", features = [
... | 1 | 1 | 1 |
86b781588691d8fe4c75618e6ac3d946ddccd423 | Tom Dohrmann | 2022-03-23T20:25:39 | add `MutexGuard::leak` | diff --git a/lock_api/src/mutex.rs b/lock_api/src/mutex.rs
index ad8ea3c..4e1b879 100644
--- a/lock_api/src/mutex.rs
+++ b/lock_api/src/mutex.rs
@@ -565,6 +565,17 @@ impl<'a, R: RawMutex + 'a, T: ?Sized + 'a> MutexGuard<'a, R, T> {
defer!(s.mutex.raw.lock());
f()
}
+
+ /// Leaks the mutex guar... | 1 | 11 | 0 |
68990abe016c9b9ccde27dd0091df638faa89af3 | Peter Johnston | 2022-03-18T14:44:09 | Update windows-sys to v0.34.0 | diff --git a/core/Cargo.toml b/core/Cargo.toml
index 254e452..a0b5961 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -23,7 +23,7 @@ libc = "0.2.95"
redox_syscall = "0.2.8"
[target.'cfg(windows)'.dependencies]
-windows-sys = { version = "0.33.0", features = [
+windows-sys = { version = "0.34.0", features = [
... | 1 | 1 | 1 |
99ab9803e3c22d4b7dad0820fdfdc2afc4b70a4e | Taiki Endo | 2022-03-10T12:55:18 | Update windows-sys to 0.33, petgraph to 0.6 | diff --git a/core/Cargo.toml b/core/Cargo.toml
index 7c3cf7b..254e452 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -12,7 +12,7 @@ edition = "2018"
[dependencies]
cfg-if = "1.0.0"
smallvec = "1.6.1"
-petgraph = { version = "0.5.1", optional = true }
+petgraph = { version = "0.6.0", optional = true }
thread-... | 1 | 2 | 2 |
9dccd342f5b64e388a3f29cc823c675e87aec212 | Scott Mabin | 2022-02-15T11:40:10 | pthread attributes are not yet supported on the esp-idf platform | diff --git a/core/src/thread_parker/unix.rs b/core/src/thread_parker/unix.rs
index c52ead9..a75e176 100644
--- a/core/src/thread_parker/unix.rs
+++ b/core/src/thread_parker/unix.rs
@@ -127,12 +127,12 @@ impl super::ThreadParkerT for ThreadParker {
impl ThreadParker {
/// Initializes the condvar to use CLOCK_MON... | 1 | 2 | 2 |
78a16dd4d54cc4466c13f44b820eb3fff6ae7cfc | Amanieu d'Antras | 2022-01-28T19:24:04 | Minor fixes | diff --git a/src/condvar.rs b/src/condvar.rs
index 2009176..9eaf300 100644
--- a/src/condvar.rs
+++ b/src/condvar.rs
@@ -380,12 +380,6 @@ impl Condvar {
///
/// Like `wait`, the lock specified will be re-acquired when this function
/// returns, regardless of whether the timeout elapsed or not.
- ///
-... | 2 | 2 | 15 |
1f942889c3df8d8007b3860d2bc2163575f1b520 | Clemens Wasser | 2022-01-08T14:44:25 | Adopt windows-rs | diff --git a/core/Cargo.toml b/core/Cargo.toml
index 74ace42..f3d3fd8 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -23,8 +23,12 @@ libc = "0.2.95"
redox_syscall = "0.2.8"
[target.'cfg(windows)'.dependencies]
-winapi = { version = "0.3.9", features = ["winnt", "ntstatus", "minwindef",
- "winerror", "winb... | 4 | 62 | 85 |
f2ab30543ce870c2db31db32d2c5d9e8be6b4860 | Amanieu d'Antras | 2021-12-19T18:56:33 | Fix build on latest nightly
asm! is now stable. | diff --git a/src/elision.rs b/src/elision.rs
index dae39cb..613aaf4 100644
--- a/src/elision.rs
+++ b/src/elision.rs
@@ -5,6 +5,8 @@
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.
+#[cfg(all(feature = "nightly", any(t... | 2 | 2 | 1 |
4f1a3384c4032b1362e207ef8a44703dbb833b54 | Heikki Linnakangas | 2021-12-13T12:21:46 | Improve comments on fair mutexes.
The description of fair mutexes contained a bunch of typos, and felt a bit
hard to read in general. | diff --git a/src/fair_mutex.rs b/src/fair_mutex.rs
index 449c53b..3e4c163 100644
--- a/src/fair_mutex.rs
+++ b/src/fair_mutex.rs
@@ -11,24 +11,21 @@ use lock_api;
/// A mutual exclusive primitive that is always fair, useful for protecting shared data
///
/// This mutex will block threads waiting for the lock to beco... | 2 | 9 | 12 |
f35f0b433837ea796b606cfb8523f4e76072f72a | Noa | 2021-11-11T23:42:18 | Use :e registers on x32 | diff --git a/src/elision.rs b/src/elision.rs
index 66d6161..dae39cb 100644
--- a/src/elision.rs
+++ b/src/elision.rs
@@ -56,6 +56,16 @@ impl AtomicElisionExt for AtomicUsize {
fn elision_compare_exchange_acquire(&self, current: usize, new: usize) -> Result<usize, usize> {
unsafe {
let prev: u... | 1 | 19 | 0 |
4c561d8837f3533d4968b7f61d34b04b1b12ba35 | Noa | 2021-11-11T22:52:52 | Switch from llvm_asm!() to new asm!() macro | diff --git a/src/elision.rs b/src/elision.rs
index 68cfa63..66d6161 100644
--- a/src/elision.rs
+++ b/src/elision.rs
@@ -52,33 +52,18 @@ impl AtomicElisionExt for AtomicUsize {
impl AtomicElisionExt for AtomicUsize {
type IntType = usize;
- #[cfg(target_pointer_width = "32")]
#[inline]
fn elision_c... | 2 | 16 | 43 |
8a681cecfa712adbf93a09708c1240ed9320e54b | Declan Kelly | 2021-11-04T18:58:31 | Add default implementation to trait method.
This ensures backwards compatibility with existing implementations
of the RawRwLock trait. | diff --git a/lock_api/src/rwlock.rs b/lock_api/src/rwlock.rs
index 5cb52ae..9bfa1da 100644
--- a/lock_api/src/rwlock.rs
+++ b/lock_api/src/rwlock.rs
@@ -86,7 +86,16 @@ pub unsafe trait RawRwLock {
}
/// Check if this `RwLock` is currently exclusively locked.
- fn is_locked_exclusive(&self) -> bool;
+ ... | 1 | 10 | 1 |
26e3c97d2fb81838dae260a3b998d38b7bb3411c | Declan Kelly | 2021-11-04T05:48:58 | Add a rwlock method to report if lock is held exclusively
Closes issue #293. | diff --git a/lock_api/src/rwlock.rs b/lock_api/src/rwlock.rs
index d81a7d2..5cb52ae 100644
--- a/lock_api/src/rwlock.rs
+++ b/lock_api/src/rwlock.rs
@@ -84,6 +84,9 @@ pub unsafe trait RawRwLock {
}
!acquired_lock
}
+
+ /// Check if this `RwLock` is currently exclusively locked.
+ fn is_lock... | 3 | 39 | 0 |
3fd2ce4cd09c286ee59af8e4c99f24061ed13216 | Amanieu d'Antras | 2021-10-31T23:48:16 | Use target_family = "wasm" | diff --git a/core/src/lib.rs b/core/src/lib.rs
index 27087f4..4845356 100644
--- a/core/src/lib.rs
+++ b/core/src/lib.rs
@@ -46,7 +46,7 @@
#![cfg_attr(
all(
feature = "nightly",
- target_arch = "wasm32",
+ target_family = "wasm",
target_feature = "atomics"
),
feature(stds... | 3 | 4 | 4 |
6e355244a3ff21b203471cec13dd306ad5fd2e70 | Amanieu d'Antras | 2021-10-31T22:16:19 | Disable eventual fairness on wasm32-unknown-unknown
std::time::Instant panics on this target and the external instant crate
adds undesirable external dependencies to the wasm module. | diff --git a/Cargo.toml b/Cargo.toml
index 4c2518e..9c72cc6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,6 @@ edition = "2018"
[dependencies]
parking_lot_core = { path = "core", version = "0.8.4" }
lock_api = { path = "lock_api", version = "0.4.5" }
-instant = "0.1.9"
[dev-dependencies]
rand = "0.8.3"
@... | 21 | 123 | 122 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.