diff Modules/socketmodule.c @ 9679:877d23bd5bdc legacy-trunk

Thanks to Chris Herborth, the thread primitives now have proper Py* names in the source code (they already had those for the linker, through some smart macros; but the source still had the old, un-Py names).
author Guido van Rossum <guido@python.org>
date Mon, 21 Dec 1998 19:32:43 +0000
parents 38023a425e48
children f81db738abd9
line wrap: on
line diff
--- a/Modules/socketmodule.c	Mon Dec 21 19:28:37 1998 +0000
+++ b/Modules/socketmodule.c	Mon Dec 21 19:32:43 1998 +0000
@@ -313,7 +313,7 @@
 /* Lock to allow python interpreter to continue, but only allow one 
    thread to be in gethostbyname */
 #if defined(WITH_THREAD) && !defined(HAVE_GETHOSTBYNAME_R) && !defined(MS_WINDOWS)
-type_lock gethostbyname_lock;
+PyThread_type_lock gethostbyname_lock;
 #endif
 
 
@@ -358,11 +358,11 @@
 	hp = gethostbyname_r(name, &hp_allocated, buf, buf_len, &errnop);
 #else /* not HAVE_GETHOSTBYNAME_R */
 #if defined(WITH_THREAD) && !defined(MS_WINDOWS)
-	acquire_lock(gethostbyname_lock,1);
+	PyThread_acquire_lock(gethostbyname_lock,1);
 #endif
 	hp = gethostbyname(name);
 #if defined(WITH_THREAD) && !defined(MS_WINDOWS)
-	release_lock(gethostbyname_lock);
+	PyThread_release_lock(gethostbyname_lock);
 #endif
 #endif /* HAVE_GETHOSTBYNAME_R */
 	Py_END_ALLOW_THREADS
@@ -1417,11 +1417,11 @@
 	h = gethostbyname_r(name, &hp_allocated, buf, buf_len, &errnop);
 #else /* not HAVE_GETHOSTBYNAME_R */
 #if defined(WITH_THREAD) && !defined(MS_WINDOWS)
-	acquire_lock(gethostbyname_lock,1);
+	PyThread_acquire_lock(gethostbyname_lock,1);
 #endif
 	h = gethostbyname(name);
 #if defined(WITH_THREAD) && !defined(MS_WINDOWS)
-	release_lock(gethostbyname_lock);
+	PyThread_release_lock(gethostbyname_lock);
 #endif
 #endif /* HAVE_GETHOSTBYNAME_R */
 	Py_END_ALLOW_THREADS
@@ -1463,13 +1463,13 @@
 			    &hp_allocated, buf, buf_len, &errnop);
 #else /* not HAVE_GETHOSTBYNAME_R */
 #if defined(WITH_THREAD) && !defined(MS_WINDOWS)
-	acquire_lock(gethostbyname_lock,1);
+	PyThread_acquire_lock(gethostbyname_lock,1);
 #endif
 	h = gethostbyaddr((char *)&addr.sin_addr,
 			  sizeof(addr.sin_addr),
 			  AF_INET);
 #if defined(WITH_THREAD) && !defined(MS_WINDOWS)
-	release_lock(gethostbyname_lock);
+	PyThread_release_lock(gethostbyname_lock);
 #endif
 #endif /* HAVE_GETHOSTBYNAME_R */
 	Py_END_ALLOW_THREADS
@@ -2188,6 +2188,6 @@
 
 	/* Initialize gethostbyname lock */
 #if defined(WITH_THREAD) && !defined(HAVE_GETHOSTBYNAME_R) && !defined(MS_WINDOWS)
-	gethostbyname_lock = allocate_lock();
+	gethostbyname_lock = PyThread_allocate_lock();
 #endif
 }