Skip to content

Commit 400fc90

Browse files
committed
Fix pthread_cond_destroy before macOS 10.7
macOS 10.7 returns `EINVAL` for `pthread_cond_destroy()`.
1 parent 2e0aa52 commit 400fc90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libstd/sys/unix/condvar.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,14 @@ impl Condvar {
164164
}
165165

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

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

0 commit comments

Comments
 (0)