diff options
author | Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2020-04-28 16:50:25 +0200 |
---|---|---|
committer | Cristian Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2020-04-30 07:20:55 +0200 |
commit | 270d2be98ad72e0cffb20339c3a42c8f81e3b8ec (patch) | |
tree | ad48835cfe46f504376d09be4a4d14d84eab4636 | |
parent | a30d24ebfea35ff883a67524fe8b1221ed1dc73d (diff) |
QMutexLocker allow-thread in constructor
After the improvement to the GIL treatment inside PySide
to avoid UI freezing issues, many functions need an entry
on the typesystem to allow thread explicitly, this was
the case of the report, where a QMutexLocker was initialized.
The initialization was done inside a QThread run method,
so the lack of allow-thread was generating a deadlock.
The nogil section of the code (from Cython)
was not related to the issue, since replacing the content with
any instruction produced the deadlock anyways.
Fixes: PYSIDE-1271
Change-Id: Ib1fd1ebd923c3f9dc9ae390228bcf40b5b878019
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r-- | sources/pyside2/PySide2/QtCore/typesystem_core_common.xml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml index 283b37d6f..53ab29382 100644 --- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml +++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml @@ -2292,7 +2292,13 @@ <enum-type name="LibraryLocation"/> </object-type> <object-type name="QMutexLocker" copyable="no"> - <modify-function signature="QMutexLocker(QBasicMutex*)"> + <!-- PYSIDE-1271: Creating locking capable objects inside sections that + contain allow-thread, require the classes to also allow having threads. + The lack of the option here, was generating a deadlock when running a + QMutexLocker inside a QThread::run. + The reason of having this change is due to the new way of handling the GIL + in the Qt calls on the whole PySide2 module, that started on 5.14.2--> + <modify-function signature="QMutexLocker(QBasicMutex*)" allow-thread="yes"> <modify-argument index="1"> <reference-count action="set" variable-name="mutex()const0"/> </modify-argument> |