Issue #7272, continued: don't re-use existing HAVE_BROKEN_POSIX_SEMAPHORES

to indicate that semaphores aren't available;  define a new variable
POSIX_SEMAPHORES_NOT_ENABLED instead.
This commit is contained in:
Mark Dickinson 2009-11-28 10:44:20 +00:00
parent 761ae0b8cc
commit 5afa6d4dcf
6 changed files with 11 additions and 8 deletions

View File

@ -251,7 +251,7 @@ init_multiprocessing(void)
PyModule_AddObject(module, "Connection", (PyObject*)&ConnectionType);
#if defined(MS_WINDOWS) || \
(defined(HAVE_SEM_OPEN) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES))
(defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED))
/* Add SemLock type to module */
if (PyType_Ready(&SemLockType) < 0)
return;
@ -298,7 +298,7 @@ init_multiprocessing(void)
Py_DECREF(temp); Py_DECREF(value); return; } \
Py_DECREF(value)
#if defined(HAVE_SEM_OPEN) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES)
#if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED)
ADD_FLAG(HAVE_SEM_OPEN);
#endif
#ifdef HAVE_SEM_TIMEDWAIT

View File

@ -27,7 +27,7 @@
# include <sys/socket.h>
# include <sys/uio.h>
# include <arpa/inet.h> /* htonl() and ntohl() */
# if defined(HAVE_SEM_OPEN) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES)
# if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED)
# include <semaphore.h>
typedef sem_t *SEM_HANDLE;
# endif

4
configure vendored
View File

@ -1,5 +1,5 @@
#! /bin/sh
# From configure.in Revision: 76432 .
# From configure.in Revision: 76550 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for python 2.7.
#
@ -23876,7 +23876,7 @@ if test $ac_cv_posix_semaphores_enabled = no
then
cat >>confdefs.h <<\_ACEOF
#define HAVE_BROKEN_POSIX_SEMAPHORES 1
#define POSIX_SEMAPHORES_NOT_ENABLED 1
_ACEOF
fi

View File

@ -3419,8 +3419,8 @@ int main(void) {
AC_MSG_RESULT($ac_cv_posix_semaphores_enabled)
if test $ac_cv_posix_semaphores_enabled = no
then
AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
[Define if the Posix semaphores do not work on your system])
AC_DEFINE(POSIX_SEMAPHORES_NOT_ENABLED, 1,
[Define if POSIX semaphores aren't enabled on your system])
fi

View File

@ -909,6 +909,9 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define if POSIX semaphores aren't enabled on your system */
#undef POSIX_SEMAPHORES_NOT_ENABLED
/* Defined if PTHREAD_SCOPE_SYSTEM supported. */
#undef PTHREAD_SYSTEM_SCHED_SUPPORTED

View File

@ -1316,7 +1316,7 @@ class PyBuildExt(build_ext):
'_multiprocessing/socket_connection.c'
]
if (sysconfig.get_config_var('HAVE_SEM_OPEN') and not
sysconfig.get_config_var('HAVE_BROKEN_POSIX_SEMAPHORES')):
sysconfig.get_config_var('POSIX_SEMAPHORES_NOT_ENABLED')):
multiprocessing_srcs.append('_multiprocessing/semaphore.c')
if sysconfig.get_config_var('WITH_THREAD'):