Skip to content

Commit

Permalink
Don't use Posix semaphores on Solaris 8. Fixes #662787.
Browse files Browse the repository at this point in the history
  • Loading branch information
loewis committed Jan 21, 2003
1 parent 2da75fa commit dfc33fd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Python/thread_pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion configure
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#! /bin/sh
# From configure.in Revision: 1.385 .
# From configure.in Revision: 1.386 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53 for python 2.3.
#
Expand Down Expand Up @@ -11132,6 +11132,15 @@ _ACEOF
fi
# Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8.
case $ac_sys_system/$ac_sys_release in
SunOS/5.8)
cat >>confdefs.h <<\_ACEOF
#define HAVE_BROKEN_POSIX_SEMAPHORES 1
_ACEOF
;;
esac
echo "$as_me:$LINENO: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5
echo $ECHO_N "checking if PTHREAD_SCOPE_SYSTEM is supported... $ECHO_C" >&6
if test "${ac_cv_pthread_system_supported+set}" = set; then
Expand Down
6 changes: 6 additions & 0 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,12 @@ pthread_create (NULL, NULL, start_routine, NULL)], [
and your system does not define that.])
fi

# Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8.
case $ac_sys_system/$ac_sys_release in
SunOS/5.8) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
Define if the Posix semaphores do not work on your system);;
esac

AC_MSG_CHECKING(if PTHREAD_SCOPE_SYSTEM is supported)
AC_CACHE_VAL(ac_cv_pthread_system_supported,
[AC_TRY_RUN([#include <pthread.h>
Expand Down
3 changes: 3 additions & 0 deletions pyconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
/* Define if nice() returns success/failure instead of the new priority. */
#undef HAVE_BROKEN_NICE

/* Define if the Posix semaphores do not work on your system */
#undef HAVE_BROKEN_POSIX_SEMAPHORES

/* Define to 1 if you have the `chown' function. */
#undef HAVE_CHOWN

Expand Down

0 comments on commit dfc33fd

Please sign in to comment.