summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sys/aio.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/sys/aio.rs b/src/sys/aio.rs
index 745ce71b..5cb3b818 100644
--- a/src/sys/aio.rs
+++ b/src/sys/aio.rs
@@ -32,6 +32,7 @@ use std::marker::PhantomData;
use std::mem;
use std::ops::Deref;
use std::ptr::{null, null_mut};
+use std::thread;
use sys::signal::*;
use sys::time::TimeSpec;
@@ -985,7 +986,8 @@ impl<'a> Drop for AioCb<'a> {
/// If the `AioCb` has no remaining state in the kernel, just drop it.
/// Otherwise, dropping constitutes a resource leak, which is an error
fn drop(&mut self) {
- assert!(!self.in_progress, "Dropped an in-progress AioCb");
+ assert!(thread::panicking() || !self.in_progress,
+ "Dropped an in-progress AioCb");
}
}