Skip to content

Commit

Permalink
Fix pthread_cond_destroy before macOS 10.7
Browse files Browse the repository at this point in the history
macOS 10.7 returns `EINVAL` for `pthread_cond_destroy()`.
  • Loading branch information
catap committed Feb 7, 2022
1 parent 05d0399 commit 11fb79e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libstd/sys/unix/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ impl Condvar {
}

#[inline]
#[cfg(not(target_os = "dragonfly"))]
#[cfg(all(not(target_os = "dragonfly"), not(feature = "macos_before_10_7")))]
pub unsafe fn destroy(&self) {
let r = libc::pthread_cond_destroy(self.inner.get());
debug_assert_eq!(r, 0);
}

#[inline]
#[cfg(target_os = "dragonfly")]
#[cfg(any(target_os = "dragonfly", feature = "macos_before_10_7"))]
pub unsafe fn destroy(&self) {
let r = libc::pthread_cond_destroy(self.inner.get());
// On DragonFly pthread_cond_destroy() returns EINVAL if called on
Expand Down

0 comments on commit 11fb79e

Please sign in to comment.