aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/ApiExtractor/abstractmetalang.h
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-07-25 11:42:39 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-07-25 12:16:31 +0000
commitbe202bd1baf600c7b422c96cc6b47a327e7a9d23 (patch)
tree187183f6636901b36c1e0c87708040c653b7d0fd /sources/shiboken2/ApiExtractor/abstractmetalang.h
parentfdae2fce386cb4d72c4528b7e868c61860c43069 (diff)
shiboken: Fix the allow-thread attribute to actually have an effect
Previously, calls to BEGIN_ALLOW_THREADS/END_ALLOW_THREADS were always generated since the value of XML attribute was not used. Fix it to actually use the value. Since having it default to "no" caused a number of deadlocks (related to thread functions or functions calling a virtual function (potentially reimplemented in Python), introduce "auto" as default value. "auto" turns off BEGIN_ALLOW_THREADS/END_ALLOW_THREADS for simple getter functions. Task-number: PYSIDE-743 Change-Id: I4833afef14f2552c75b3424417c2702ce25cb379 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/abstractmetalang.h')
-rw-r--r--sources/shiboken2/ApiExtractor/abstractmetalang.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/abstractmetalang.h b/sources/shiboken2/ApiExtractor/abstractmetalang.h
index da3b72e1c..f55f61eb4 100644
--- a/sources/shiboken2/ApiExtractor/abstractmetalang.h
+++ b/sources/shiboken2/ApiExtractor/abstractmetalang.h
@@ -1084,6 +1084,8 @@ public:
#endif
private:
+ bool autoDetectAllowThread() const;
+
QString m_name;
QString m_originalName;
mutable QString m_cachedMinimalSignature;
@@ -1105,6 +1107,7 @@ private:
uint m_isNoExcept : 1;
uint m_pointerOperator : 1;
uint m_isCallOperator : 1;
+ mutable int m_cachedAllowThread = -1;
};
Q_DECLARE_OPERATORS_FOR_FLAGS(AbstractMetaFunction::CompareResult)