Skip to content

Commit b7622e7

Browse files
miss-islingtonnjsmithblurb-it[bot]
authored
[3.11] GH-104308: socket.getnameinfo should release the GIL (GH-104307) (#104313)
GH-104308: socket.getnameinfo should release the GIL (GH-104307) * socket.getnameinfo should release the GIL * 📜🤖 Added by blurb_it. --------- (cherry picked from commit faf1962) Co-authored-by: Nathaniel J. Smith <[email protected]> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
1 parent 2ee2503 commit b7622e7

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:func:`socket.getnameinfo` now releases the GIL while contacting the DNS server

Modules/socketmodule.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6737,8 +6737,10 @@ socket_getnameinfo(PyObject *self, PyObject *args)
67376737
}
67386738
#endif
67396739
}
6740+
Py_BEGIN_ALLOW_THREADS
67406741
error = getnameinfo(res->ai_addr, (socklen_t) res->ai_addrlen,
67416742
hbuf, sizeof(hbuf), pbuf, sizeof(pbuf), flags);
6743+
Py_END_ALLOW_THREADS
67426744
if (error) {
67436745
set_gaierror(error);
67446746
goto fail;

0 commit comments

Comments
 (0)