]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Patch #1288833: Removed thread lock from socket.getaddrinfo on
authorHye-Shik Chang <hyeshik@gmail.com>
Sat, 24 Sep 2005 14:58:47 +0000 (14:58 +0000)
committerHye-Shik Chang <hyeshik@gmail.com>
Sat, 24 Sep 2005 14:58:47 +0000 (14:58 +0000)
FreeBSD 5.3 and later versions which got thread-safe getaddrinfo(3).
(Reported by Maxim Sobolev)

Misc/NEWS
Modules/socketmodule.c

index 93c2ba0c4952ad5624d2bd96d2cc34a1f772beb2..00bd2471de625ab5d1af51a3f701563bfa10199c 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -149,6 +149,9 @@ present).
 Extension Modules
 -----------------
 
+- Patch #1288833: Removed thread lock from socket.getaddrinfo on
+  FreeBSD 5.3 and later versions which got thread-safe getaddrinfo(3).
+
 - Patches #1298449 and #1298499: Add some missing checks for error
   returns in cStringIO.c.
 
index 4c0a0fcf5d5799932d784d6b532888ff11926c39..e3573e37d15ce99581690cfc585a5990fb47f43f 100644 (file)
@@ -140,9 +140,14 @@ shutdown(how) -- shut down traffic in one or both directions\n\
 # define USE_GETHOSTBYNAME_LOCK
 #endif
 
+/* To use __FreeBSD_version */
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
 /* On systems on which getaddrinfo() is believed to not be thread-safe,
    (this includes the getaddrinfo emulation) protect access with a lock. */
-#if defined(WITH_THREAD) && (defined(__APPLE__) || defined(__FreeBSD__) || \
+#if defined(WITH_THREAD) && (defined(__APPLE__) || \
+    (defined(__FreeBSD__) && __FreeBSD_version+0 < 503000) || \
     defined(__OpenBSD__) || defined(__NetBSD__) || !defined(HAVE_GETADDRINFO))
 #define USE_GETADDRINFO_LOCK
 #endif