From: Martin v. Löwis Date: Mon, 24 Jul 2006 10:26:33 +0000 (+0000) Subject: Patch #1448199: Release GIL around ConnectRegistry. X-Git-Tag: v2.5b3~184 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bda0dde1c46c7f86c09f1b54d0b14125e9ab7f52;p=python Patch #1448199: Release GIL around ConnectRegistry. --- diff --git a/Lib/test/test_winreg.py b/Lib/test/test_winreg.py index a9bc962155..5830fd64f5 100644 --- a/Lib/test/test_winreg.py +++ b/Lib/test/test_winreg.py @@ -151,3 +151,6 @@ if remote_name is not None: else: print "Remote registry calls can be tested using", print "'test_winreg.py --remote \\\\machine_name'" + # perform minimal ConnectRegistry test which just invokes it + h = ConnectRegistry(None, HKEY_LOCAL_MACHINE) + h.Close() diff --git a/Misc/NEWS b/Misc/NEWS index ba6d0f8c68..7a6e22d563 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -61,6 +61,8 @@ Library Extension Modules ----------------- +- Patch #1448199: Release interpreter lock in _winreg.ConnectRegistry. + - Patch #1521817: Index range checking on ctypes arrays containing exactly one element enabled again. This allows iterating over these arrays, without the need to check the array size before. diff --git a/PC/_winreg.c b/PC/_winreg.c index 007885c679..b39411a8ca 100644 --- a/PC/_winreg.c +++ b/PC/_winreg.c @@ -960,7 +960,9 @@ PyConnectRegistry(PyObject *self, PyObject *args) return NULL; if (!PyHKEY_AsHKEY(obKey, &hKey, FALSE)) return NULL; + Py_BEGIN_ALLOW_THREADS rc = RegConnectRegistry(szCompName, hKey, &retKey); + Py_END_ALLOW_THREADS if (rc != ERROR_SUCCESS) return PyErr_SetFromWindowsErrWithFunction(rc, "ConnectRegistry");