diff options
author | Hye-Shik Chang <hyeshik@gmail.com> | 2005-09-24 14:58:47 (GMT) |
---|---|---|
committer | Hye-Shik Chang <hyeshik@gmail.com> | 2005-09-24 14:58:47 (GMT) |
commit | 9ceebd544516908e67c0f0d92c7a5f484e12beeb (patch) | |
tree | 165f7d3b6342429d3be172d794957f8bd7e29aaf /Modules | |
parent | 3a708dfc88e374b5d311ad736c0938a8b7c55164 (diff) | |
download | cpython-9ceebd544516908e67c0f0d92c7a5f484e12beeb.zip cpython-9ceebd544516908e67c0f0d92c7a5f484e12beeb.tar.gz cpython-9ceebd544516908e67c0f0d92c7a5f484e12beeb.tar.bz2 |
Patch #1288833: Removed thread lock from socket.getaddrinfo on
FreeBSD 5.3 and later versions which got thread-safe getaddrinfo(3).
(Reported by Maxim Sobolev)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/socketmodule.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 4c0a0fc..e3573e3 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -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 |