Skip to content

Commit e6ae758

Browse files
njsmithblurb-it[bot]
authored andcommitted
pythonGH-104308: socket.getnameinfo should release the GIL (pythonGH-104307)
* socket.getnameinfo should release the GIL * 📜🤖 Added by blurb_it. --------- (cherry picked from commit faf1962) Co-authored-by: Nathaniel J. Smith <njs@pobox.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
1 parent 2ee2503 commit e6ae758

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)