Skip to content

Commit

Permalink
Simplify debug_asserts.
Browse files Browse the repository at this point in the history
  • Loading branch information
ltratt committed Dec 21, 2020
1 parent b6d4fdb commit 36a77db
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions core/src/thread_parker/unix.rs
Expand Up @@ -156,17 +156,9 @@ impl Drop for ThreadParker {
// this behaviour no longer occurs. The same applies to condvars.
unsafe {
let r = libc::pthread_mutex_destroy(self.mutex.get());
if cfg!(target_os = "dragonfly") {
debug_assert!(r == 0 || r == libc::EINVAL);
} else {
debug_assert_eq!(r, 0);
}
debug_assert!(r == 0 || r == libc::EINVAL);
let r = libc::pthread_cond_destroy(self.condvar.get());
if cfg!(target_os = "dragonfly") {
debug_assert!(r == 0 || r == libc::EINVAL);
} else {
debug_assert_eq!(r, 0);
}
debug_assert!(r == 0 || r == libc::EINVAL);
}
}
}
Expand Down

0 comments on commit 36a77db

Please sign in to comment.