Gate nightly diagnostics behind feature
This commit is contained in:
parent
0e459aae92
commit
b76ac9f405
6 changed files with 18 additions and 12 deletions
|
|
@ -114,7 +114,7 @@ impl<T> TrackedMutex<T> {
|
|||
Self { inner: Mutex::new(value) }
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
|
||||
pub async fn lock(&self) -> TrackedMutexGuard<'_, T> {
|
||||
let location = Location::caller();
|
||||
let guard = self.inner.lock().await;
|
||||
|
|
@ -125,7 +125,7 @@ impl<T> TrackedMutex<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
|
||||
pub fn try_lock(&self) -> Result<TrackedMutexGuard<'_, T>, tokio::sync::TryLockError> {
|
||||
let location = Location::caller();
|
||||
let guard = self.inner.try_lock()?;
|
||||
|
|
@ -171,7 +171,7 @@ impl<T> TrackedRwLock<T> {
|
|||
Self { inner: RwLock::new(value) }
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
|
||||
pub async fn read(&self) -> TrackedRwLockReadGuard<'_, T> {
|
||||
let location = Location::caller();
|
||||
let guard = self.inner.read().await;
|
||||
|
|
@ -182,7 +182,7 @@ impl<T> TrackedRwLock<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
#[cfg_attr(feature = "nightly-diagnostics", track_caller)]
|
||||
pub async fn write(&self) -> TrackedRwLockWriteGuard<'_, T> {
|
||||
let location = Location::caller();
|
||||
let guard = self.inner.write().await;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue