Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dfc33fd

Browse files
committed
Don't use Posix semaphores on Solaris 8. Fixes #662787.
1 parent 2da75fa commit dfc33fd

4 files changed

Lines changed: 20 additions & 2 deletions

File tree

Python/thread_pthread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
/* Whether or not to use semaphores directly rather than emulating them with
105105
* mutexes and condition variables:
106106
*/
107-
#ifdef _POSIX_SEMAPHORES
107+
#if defined(_POSIX_SEMAPHORES) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES)
108108
# define USE_SEMAPHORES
109109
#else
110110
# undef USE_SEMAPHORES

configure

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh
2-
# From configure.in Revision: 1.385 .
2+
# From configure.in Revision: 1.386 .
33
# Guess values for system-dependent variables and create Makefiles.
44
# Generated by GNU Autoconf 2.53 for python 2.3.
55
#
@@ -11132,6 +11132,15 @@ _ACEOF
1113211132
1113311133
fi
1113411134
11135+
# Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8.
11136+
case $ac_sys_system/$ac_sys_release in
11137+
SunOS/5.8)
11138+
cat >>confdefs.h <<\_ACEOF
11139+
#define HAVE_BROKEN_POSIX_SEMAPHORES 1
11140+
_ACEOF
11141+
;;
11142+
esac
11143+
1113511144
echo "$as_me:$LINENO: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5
1113611145
echo $ECHO_N "checking if PTHREAD_SCOPE_SYSTEM is supported... $ECHO_C" >&6
1113711146
if test "${ac_cv_pthread_system_supported+set}" = set; then

configure.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,12 @@ pthread_create (NULL, NULL, start_routine, NULL)], [
14471447
and your system does not define that.])
14481448
fi
14491449

1450+
# Bug 662787: Using semaphores causes unexplicable hangs on Solaris 8.
1451+
case $ac_sys_system/$ac_sys_release in
1452+
SunOS/5.8) AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
1453+
Define if the Posix semaphores do not work on your system);;
1454+
esac
1455+
14501456
AC_MSG_CHECKING(if PTHREAD_SCOPE_SYSTEM is supported)
14511457
AC_CACHE_VAL(ac_cv_pthread_system_supported,
14521458
[AC_TRY_RUN([#include <pthread.h>

pyconfig.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
/* Define if nice() returns success/failure instead of the new priority. */
4545
#undef HAVE_BROKEN_NICE
4646

47+
/* Define if the Posix semaphores do not work on your system */
48+
#undef HAVE_BROKEN_POSIX_SEMAPHORES
49+
4750
/* Define to 1 if you have the `chown' function. */
4851
#undef HAVE_CHOWN
4952

0 commit comments

Comments
 (0)