Skip to content

Commit e0045bf

Browse files
committed
Fix pthread_cond_destroy before macOS 10.7
macOS 10.7 returns `EINVAL` for `pthread_cond_destroy()`.
1 parent 9618ea6 commit e0045bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/std/src/sys/unix/condvar.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,14 @@ impl Condvar {
157157
}
158158

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

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

0 commit comments

Comments
 (0)