diff options
author | Christian Tismer <tismer@stackless.com> | 2020-03-30 19:46:41 +0200 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2020-04-02 15:11:06 +0200 |
commit | fe77dce7a7e713456454e5c0a071f7cc70261b98 (patch) | |
tree | bd904887a1b53856f9b95f521e8c1debe1d13b25 /sources/shiboken2/libshiboken/pep384impl.h | |
parent | 79c74e1999d2b29bc918f6d42079c34174bb137d (diff) |
shiboken: Fix dict access without GIL
In PYSIDE-803 we used an optimization that accessed
a dictionary without holding the GIL. This turned out to be not
correct, because PyDict_GetItem works with thread state
to maintain the global error variables.
PyDict_GetItemWithErrors can be used instead in a way that
allows releasing the GIL.
Task-number: PYSIDE-803
Task-number: PYSIDE-813
Change-Id: Ifb0cbb20c21ca9c8b3d099fff1db5410eb6824b4
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken2/libshiboken/pep384impl.h')
-rw-r--r-- | sources/shiboken2/libshiboken/pep384impl.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sources/shiboken2/libshiboken/pep384impl.h b/sources/shiboken2/libshiboken/pep384impl.h index 676e6c82d..e735095e8 100644 --- a/sources/shiboken2/libshiboken/pep384impl.h +++ b/sources/shiboken2/libshiboken/pep384impl.h @@ -279,6 +279,17 @@ LIBSHIBOKEN_API char *_PepUnicode_AsString(PyObject *); /***************************************************************************** * + * RESOLVED: dictobject.h + * + * PYSIDE-803, PYSIDE-813: We need PyDict_GetItemWithError in order to + * avoid the GIL. + */ +#if PY_VERSION_HEX < 0x03000000 +LIBSHIBOKEN_API PyObject *PyDict_GetItemWithError(PyObject *mp, PyObject *key); +#endif + +/***************************************************************************** + * * RESOLVED: methodobject.h * */ |