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:
parent
761ae0b8cc
commit
5afa6d4dcf
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
2
setup.py
2
setup.py
|
@ -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'):
|
||||
|
|
Loading…
Reference in New Issue