Allow threads while listening for connections on a pipe

This commit is contained in:
Kovid Goyal 2020-10-15 20:30:20 +05:30
parent 2ddbbb3a43
commit 2a1b05dc05
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -709,7 +709,11 @@ static PyObject *
connect_named_pipe(PyObject *self, PyObject *args) {
HANDLE handle;
if (!PyArg_ParseTuple(args, "O&", convert_handle, &handle)) return NULL;
if (!ConnectNamedPipe(handle, NULL)) return set_error_from_handle(args);
BOOL ok;
Py_BEGIN_ALLOW_THREADS;
ok = ConnectNamedPipe(handle, NULL)
Py_END_ALLOW_THREADS;
if (!ok) return set_error_from_handle(args);
Py_RETURN_NONE;
}