Don't use Posix semaphores on Solaris 8. Fixes #662787.
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index 8067121..e30982f 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -104,7 +104,7 @@
 /* Whether or not to use semaphores directly rather than emulating them with
  * mutexes and condition variables:
  */
-#ifdef _POSIX_SEMAPHORES
+#if defined(_POSIX_SEMAPHORES) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES)
 #  define USE_SEMAPHORES
 #else
 #  undef USE_SEMAPHORES