Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion crates/egui_extras/src/loaders/ehttp_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ impl BytesLoader for EhttpLoader {
{
let entry = entry.get_mut();
*entry = Poll::Ready(result);
ctx.request_repaint();
log::trace!("Finished loading {uri:?}");
true
} else {
Expand Down
1 change: 0 additions & 1 deletion crates/egui_extras/src/loaders/file_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ impl BytesLoader for FileLoader {
if let std::collections::hash_map::Entry::Occupied(mut entry) = cache.entry(uri.clone()) {
let entry = entry.get_mut();
*entry = Poll::Ready(result);
ctx.request_repaint();
log::trace!("Finished loading {uri:?}");
true
} else {
Expand Down
27 changes: 18 additions & 9 deletions crates/epaint/src/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ impl<T> Mutex<T> {
#[cfg_attr(debug_assertions, track_caller)]
pub fn lock(&self) -> MutexGuard<'_, T> {
if cfg!(debug_assertions) {
self.0
.try_lock_for(DEADLOCK_DURATION)
.expect("Looks like a deadlock!")
self.0.try_lock_for(DEADLOCK_DURATION).unwrap_or_else(|| {
panic!(
"DEBUG PANIC: Failed to acquire Mutex after {}s. Deadlock?",
DEADLOCK_DURATION.as_secs()
)
})
} else {
self.0.lock()
}
Expand Down Expand Up @@ -74,9 +77,12 @@ impl<T: ?Sized> RwLock<T> {
#[cfg_attr(debug_assertions, track_caller)]
pub fn read(&self) -> RwLockReadGuard<'_, T> {
let guard = if cfg!(debug_assertions) {
self.0
.try_read_for(DEADLOCK_DURATION)
.expect("Looks like a deadlock!")
self.0.try_read_for(DEADLOCK_DURATION).unwrap_or_else(|| {
panic!(
"DEBUG PANIC: Failed to acquire RwLock read after {}s. Deadlock?",
DEADLOCK_DURATION.as_secs()
)
})
} else {
self.0.read()
};
Expand All @@ -91,9 +97,12 @@ impl<T: ?Sized> RwLock<T> {
#[cfg_attr(debug_assertions, track_caller)]
pub fn write(&self) -> RwLockWriteGuard<'_, T> {
let guard = if cfg!(debug_assertions) {
self.0
.try_write_for(DEADLOCK_DURATION)
.expect("Looks like a deadlock!")
self.0.try_write_for(DEADLOCK_DURATION).unwrap_or_else(|| {
panic!(
"DEBUG PANIC: Failed to acquire RwLock write after {}s. Deadlock?",
DEADLOCK_DURATION.as_secs()
)
})
} else {
self.0.write()
};
Expand Down
Loading