mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
Add track_caller to Mutex and RwLock for deadlock_detection
This commit is contained in:
@@ -27,6 +27,7 @@ mod mutex_impl {
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
#[cfg_attr(debug_assertions, track_caller)]
|
||||
pub fn lock(&self) -> MutexGuard<'_, T> {
|
||||
if cfg!(debug_assertions) {
|
||||
self.0
|
||||
@@ -157,6 +158,7 @@ mod rw_lock_impl {
|
||||
|
||||
impl<T: ?Sized> RwLock<T> {
|
||||
#[inline(always)]
|
||||
#[cfg_attr(debug_assertions, track_caller)]
|
||||
pub fn read(&self) -> RwLockReadGuard<'_, T> {
|
||||
let guard = if cfg!(debug_assertions) {
|
||||
self.0
|
||||
@@ -169,6 +171,7 @@ mod rw_lock_impl {
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
#[cfg_attr(debug_assertions, track_caller)]
|
||||
pub fn write(&self) -> RwLockWriteGuard<'_, T> {
|
||||
let guard = if cfg!(debug_assertions) {
|
||||
self.0
|
||||
|
||||
Reference in New Issue
Block a user