]> granicus.if.org Git - python/commitdiff
Yet another addition to [731644]: only use the lock if thread-support
authorJust van Rossum <just@letterror.com>
Fri, 9 May 2003 08:12:00 +0000 (08:12 +0000)
committerJust van Rossum <just@letterror.com>
Fri, 9 May 2003 08:12:00 +0000 (08:12 +0000)
is enabled.

Modules/socketmodule.c

index 4447f096b3c0edc1dfb4aa6952b3b3a53ba62bc4..fc5ea8f6dfbad532f61d2e304c9452868961a8fd 100644 (file)
@@ -142,8 +142,8 @@ shutdown(how) -- shut down traffic in one or both directions\n\
 
 /* On systems on which getaddrinfo() is believed to not be thread-safe,
    (this includes the getaddrinfo emulation) protect access with a lock. */
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
-    defined(__NetBSD__) || !defined(HAVE_GETADDRINFO)
+#if defined(WITH_THREAD) && (defined(__APPLE__) || defined(__FreeBSD__) || \
+    defined(__OpenBSD__) || defined(__NetBSD__) || !defined(HAVE_GETADDRINFO))
 #define USE_GETADDRINFO_LOCK
 #endif