From ac26fb414f4a2c84da35c793a80560c0b63682b2 Mon Sep 17 00:00:00 2001
From: "Kirill A. Korinsky" <kirill@korins.ky>
Date: Thu, 17 Feb 2022 15:12:11 +0100
Subject: [PATCH] macOS 10.6: Fix `pthread_cond_destroy`

macOS 10.7 returns `EINVAL` for `pthread_cond_destroy()`.
---
 library/std/src/sys/unix/condvar.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/library/std/src/sys/unix/condvar.rs b/library/std/src/sys/unix/condvar.rs
index e38f91af9f..c03c22b2cf 100644
--- a/library/std/src/sys/unix/condvar.rs
+++ b/library/std/src/sys/unix/condvar.rs
@@ -157,14 +157,14 @@ impl Condvar {
     }
 
     #[inline]
-    #[cfg(not(target_os = "dragonfly"))]
+    #[cfg(all(not(target_os = "dragonfly"), not(target_os = "macos")))]
     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", target_os = "macos"))]
     pub unsafe fn destroy(&self) {
         let r = libc::pthread_cond_destroy(self.inner.get());
         // On DragonFly pthread_cond_destroy() returns EINVAL if called on
-- 
2.37.2

