Skip to content

Commit 0de2085

Browse files
committed
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.
1 parent 90b11a7 commit 0de2085

6 files changed

Lines changed: 11 additions & 8 deletions

File tree

Modules/_multiprocessing/multiprocessing.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ init_multiprocessing(void)
251251
PyModule_AddObject(module, "Connection", (PyObject*)&ConnectionType);
252252

253253
#if defined(MS_WINDOWS) || \
254-
(defined(HAVE_SEM_OPEN) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES))
254+
(defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED))
255255
/* Add SemLock type to module */
256256
if (PyType_Ready(&SemLockType) < 0)
257257
return;
@@ -298,7 +298,7 @@ init_multiprocessing(void)
298298
Py_DECREF(temp); Py_DECREF(value); return; } \
299299
Py_DECREF(value)
300300

301-
#if defined(HAVE_SEM_OPEN) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES)
301+
#if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED)
302302
ADD_FLAG(HAVE_SEM_OPEN);
303303
#endif
304304
#ifdef HAVE_SEM_TIMEDWAIT

Modules/_multiprocessing/multiprocessing.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# include <sys/socket.h>
2828
# include <sys/uio.h>
2929
# include <arpa/inet.h> /* htonl() and ntohl() */
30-
# if defined(HAVE_SEM_OPEN) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES)
30+
# if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED)
3131
# include <semaphore.h>
3232
typedef sem_t *SEM_HANDLE;
3333
# endif

configure

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh
2-
# From configure.in Revision: 76432 .
2+
# From configure.in Revision: 76550 .
33
# Guess values for system-dependent variables and create Makefiles.
44
# Generated by GNU Autoconf 2.61 for python 2.7.
55
#
@@ -23876,7 +23876,7 @@ if test $ac_cv_posix_semaphores_enabled = no
2387623876
then
2387723877

2387823878
cat >>confdefs.h <<\_ACEOF
23879-
#define HAVE_BROKEN_POSIX_SEMAPHORES 1
23879+
#define POSIX_SEMAPHORES_NOT_ENABLED 1
2388023880
_ACEOF
2388123881

2388223882
fi

configure.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3419,8 +3419,8 @@ int main(void) {
34193419
AC_MSG_RESULT($ac_cv_posix_semaphores_enabled)
34203420
if test $ac_cv_posix_semaphores_enabled = no
34213421
then
3422-
AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1,
3423-
[Define if the Posix semaphores do not work on your system])
3422+
AC_DEFINE(POSIX_SEMAPHORES_NOT_ENABLED, 1,
3423+
[Define if POSIX semaphores aren't enabled on your system])
34243424
fi
34253425

34263426

pyconfig.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,9 @@
909909
/* Define to the version of this package. */
910910
#undef PACKAGE_VERSION
911911

912+
/* Define if POSIX semaphores aren't enabled on your system */
913+
#undef POSIX_SEMAPHORES_NOT_ENABLED
914+
912915
/* Defined if PTHREAD_SCOPE_SYSTEM supported. */
913916
#undef PTHREAD_SYSTEM_SCHED_SUPPORTED
914917

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,7 @@ class db_found(Exception): pass
13161316
'_multiprocessing/socket_connection.c'
13171317
]
13181318
if (sysconfig.get_config_var('HAVE_SEM_OPEN') and not
1319-
sysconfig.get_config_var('HAVE_BROKEN_POSIX_SEMAPHORES')):
1319+
sysconfig.get_config_var('POSIX_SEMAPHORES_NOT_ENABLED')):
13201320
multiprocessing_srcs.append('_multiprocessing/semaphore.c')
13211321

13221322
if sysconfig.get_config_var('WITH_THREAD'):

0 commit comments

Comments
 (0)