summaryrefslogtreecommitdiffstats
path: root/Modules/_multiprocessing
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2009-11-20 19:30:22 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2009-11-20 19:30:22 (GMT)
commitc4920e86ef7511b4e858028e870b1811437a71d0 (patch)
tree5cf1eca3d52fa0b815159c483e9108115dc05fcb /Modules/_multiprocessing
parentab44226198f844d2854d13395c5fd303fb9e3570 (diff)
downloadcpython-c4920e86ef7511b4e858028e870b1811437a71d0.zip
cpython-c4920e86ef7511b4e858028e870b1811437a71d0.tar.gz
cpython-c4920e86ef7511b4e858028e870b1811437a71d0.tar.bz2
Issue #7272: Add configure test to detect whether sem_open works
properly, and use this to skip test_multiprocessing on platforms where sem_open raises a signal. This should fix some FreeBSD buildbot failures for test_multiprocessing.
Diffstat (limited to 'Modules/_multiprocessing')
-rw-r--r--Modules/_multiprocessing/multiprocessing.c5
-rw-r--r--Modules/_multiprocessing/multiprocessing.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c
index 9008f31..cb6725b 100644
--- a/Modules/_multiprocessing/multiprocessing.c
+++ b/Modules/_multiprocessing/multiprocessing.c
@@ -250,7 +250,8 @@ init_multiprocessing(void)
Py_INCREF(&ConnectionType);
PyModule_AddObject(module, "Connection", (PyObject*)&ConnectionType);
-#if defined(MS_WINDOWS) || defined(HAVE_SEM_OPEN)
+#if defined(MS_WINDOWS) || \
+ (defined(HAVE_SEM_OPEN) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES))
/* Add SemLock type to module */
if (PyType_Ready(&SemLockType) < 0)
return;
@@ -297,7 +298,7 @@ init_multiprocessing(void)
Py_DECREF(temp); Py_DECREF(value); return; } \
Py_DECREF(value)
-#ifdef HAVE_SEM_OPEN
+#if defined(HAVE_SEM_OPEN) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES)
ADD_FLAG(HAVE_SEM_OPEN);
#endif
#ifdef HAVE_SEM_TIMEDWAIT
diff --git a/Modules/_multiprocessing/multiprocessing.h b/Modules/_multiprocessing/multiprocessing.h
index 7a79d6e..7c98ca7 100644
--- a/Modules/_multiprocessing/multiprocessing.h
+++ b/Modules/_multiprocessing/multiprocessing.h
@@ -27,7 +27,7 @@
# include <sys/socket.h>
# include <sys/uio.h>
# include <arpa/inet.h> /* htonl() and ntohl() */
-# ifdef HAVE_SEM_OPEN
+# if defined(HAVE_SEM_OPEN) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES)
# include <semaphore.h>
typedef sem_t *SEM_HANDLE;
# endif