mirror of
https://github.com/bertptrs/tracing-mutex.git
synced 2025-12-26 05:00:31 +01:00
Add new reset_dependencies API
This commit is contained in:
@@ -10,6 +10,7 @@ use std::sync::TryLockResult;
|
||||
use std::sync::WaitTimeoutResult;
|
||||
use std::time::Duration;
|
||||
|
||||
use crate::util::PrivateTraced;
|
||||
use crate::BorrowedMutex;
|
||||
use crate::LazyMutexId;
|
||||
|
||||
@@ -127,6 +128,12 @@ impl<T> Mutex<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> PrivateTraced for Mutex<T> {
|
||||
fn get_id(&self) -> &crate::MutexId {
|
||||
&self.id
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> From<T> for Mutex<T> {
|
||||
fn from(t: T) -> Self {
|
||||
Self::new(t)
|
||||
@@ -375,6 +382,12 @@ impl<T> RwLock<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> PrivateTraced for RwLock<T> {
|
||||
fn get_id(&self) -> &crate::MutexId {
|
||||
&self.id
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> From<T> for RwLock<T> {
|
||||
fn from(t: T) -> Self {
|
||||
Self::new(t)
|
||||
@@ -455,6 +468,12 @@ impl Once {
|
||||
}
|
||||
}
|
||||
|
||||
impl PrivateTraced for Once {
|
||||
fn get_id(&self) -> &crate::MutexId {
|
||||
&self.mutex_id
|
||||
}
|
||||
}
|
||||
|
||||
/// Wrapper for [`std::sync::OnceLock`]
|
||||
///
|
||||
/// The exact locking behaviour of [`std::sync::OnceLock`] is currently undefined, but may
|
||||
@@ -553,6 +572,12 @@ impl<T> OnceLock<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> PrivateTraced for OnceLock<T> {
|
||||
fn get_id(&self) -> &crate::MutexId {
|
||||
&self.id
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Default for OnceLock<T> {
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
|
||||
Reference in New Issue
Block a user