mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
closes bpo-31903: Release the GIL when calling into SystemConfiguration (GH-4178)
This commit is contained in:
parent
ec014a101a
commit
4859ba0d2c
2 changed files with 8 additions and 0 deletions
|
|
@ -0,0 +1,2 @@
|
||||||
|
In :mod:`_scproxy`, drop the GIL when calling into ``SystemConfiguration`` to avoid
|
||||||
|
deadlocks.
|
||||||
|
|
@ -62,7 +62,10 @@ get_proxy_settings(PyObject* Py_UNUSED(mod), PyObject *Py_UNUSED(ignored))
|
||||||
PyObject* v;
|
PyObject* v;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
Py_BEGIN_ALLOW_THREADS
|
||||||
proxyDict = SCDynamicStoreCopyProxies(NULL);
|
proxyDict = SCDynamicStoreCopyProxies(NULL);
|
||||||
|
Py_END_ALLOW_THREADS
|
||||||
|
|
||||||
if (!proxyDict) {
|
if (!proxyDict) {
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
@ -172,7 +175,10 @@ get_proxies(PyObject* Py_UNUSED(mod), PyObject *Py_UNUSED(ignored))
|
||||||
int r;
|
int r;
|
||||||
CFDictionaryRef proxyDict = NULL;
|
CFDictionaryRef proxyDict = NULL;
|
||||||
|
|
||||||
|
Py_BEGIN_ALLOW_THREADS
|
||||||
proxyDict = SCDynamicStoreCopyProxies(NULL);
|
proxyDict = SCDynamicStoreCopyProxies(NULL);
|
||||||
|
Py_END_ALLOW_THREADS
|
||||||
|
|
||||||
if (proxyDict == NULL) {
|
if (proxyDict == NULL) {
|
||||||
return PyDict_New();
|
return PyDict_New();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue