We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3996e3e commit 8844366Copy full SHA for 8844366
core/src/thread_parker/sgx.rs
@@ -89,9 +89,14 @@ impl UnparkHandle {
89
// released to avoid blocking the queue for too long.
90
#[inline]
91
pub fn unpark(self) {
92
- if let Err(error) = usercalls::send(EV_UNPARK, Some(self.0)) {
93
- if error.kind() != io::ErrorKind::InvalidInput {
94
- panic!("send returned an unexpected error: {:?}", error);
+ let result = usercalls::send(EV_UNPARK, Some(self.0));
+ if cfg!(debug_assertions) {
+ if let Err(error) = result {
95
+ // `InvalidInput` may be returned if the thread we send to has
96
+ // already been unparked and exited.
97
+ if error.kind() != io::ErrorKind::InvalidInput {
98
+ panic!("send returned an unexpected error: {:?}", error);
99
+ }
100
}
101
102
0 commit comments