Skip to content

Commit a2a413c

Browse files
committed
Fix pthread_cond_destroy before macOS 10.7
macOS 10.7 returns `EINVAL` for `pthread_cond_destroy()`.
1 parent dab463c commit a2a413c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libstd/sys/unix/condvar.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,14 @@ impl Condvar {
161161
}
162162

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

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

0 commit comments

Comments
 (0)