aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-06-26 17:53:49 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-06-26 17:53:49 +0200
commit41b49a16d62f5c759e4f8053cefa10b3f0390b31 (patch)
treee0a24fb8f1f96021220eb5fc894fccfac2247189
parentff94459c809e2ccd13e6d669b053667d35b3e571 (diff)
parent52f29458d7d6cb379d28d84021819516723d9169 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
-rw-r--r--coin/instructions/execute_test_instructions.yaml2
-rw-r--r--coin_build_instructions.py4
-rw-r--r--coin_test_instructions.py4
-rw-r--r--sources/pyside2/PySide2/QtCore/typesystem_core_common.xml8
-rw-r--r--sources/pyside2/PySide2/glue/qtcore.cpp28
-rw-r--r--sources/shiboken2/libshiboken/gilstate.cpp7
-rw-r--r--sources/shiboken2/libshiboken/gilstate.h1
7 files changed, 50 insertions, 4 deletions
diff --git a/coin/instructions/execute_test_instructions.yaml b/coin/instructions/execute_test_instructions.yaml
index 87abb476c..a00f5676e 100644
--- a/coin/instructions/execute_test_instructions.yaml
+++ b/coin/instructions/execute_test_instructions.yaml
@@ -30,7 +30,7 @@ instructions:
- type: ExecuteCommand
command: "c:\\users\\qt\\MSVC.bat python -u coin_test_instructions.py --os={{.Env.CI_OS}} {{.Env.CI_PACKAGING_FEATURE}} --instdir=\\Users\\qt\\work\\install --targetOs={{.Env.CI_OS}} --hostArch=X86_64 --targetArch={{.Env.CI_TARGET_ARCHITECTURE}}"
maxTimeInSeconds: 14400
- maxTimeBetweenOutput: 300
+ maxTimeBetweenOutput: 500
enable_if:
condition: property
property: host.os
diff --git a/coin_build_instructions.py b/coin_build_instructions.py
index bfb10410c..f3f8d2016 100644
--- a/coin_build_instructions.py
+++ b/coin_build_instructions.py
@@ -47,6 +47,8 @@ from build_scripts.utils import get_ci_qmake_path
import os
import datetime
import calendar
+import site
+import sys
# Values must match COIN thrift
CI_HOST_OS = option_value("os")
@@ -110,7 +112,7 @@ def call_setup(python_ver, phase):
if phase in ["BUILD"]:
rmtree(_env, True)
# Pinning the virtualenv before creating one
- run_instruction(["pip", "install", "--user", "virtualenv==20.0.20"], "Failed to pin virtualenv")
+ run_instruction(["pip", "install", "--user", "virtualenv==20.0.25"], "Failed to pin virtualenv")
run_instruction(["virtualenv", "-p", _pExe, _env], "Failed to create virtualenv")
# When the 'python_ver' variable is empty, we are using Python 2
# Pip is always upgraded when CI template is provisioned, upgrading it in later phase may cause perm issue
diff --git a/coin_test_instructions.py b/coin_test_instructions.py
index c3752cb9f..79a788038 100644
--- a/coin_test_instructions.py
+++ b/coin_test_instructions.py
@@ -44,6 +44,8 @@ from build_scripts.utils import run_instruction
from build_scripts.utils import rmtree
from build_scripts.utils import get_ci_qmake_path
import os
+import site
+import sys
# Values must match COIN thrift
CI_HOST_OS = option_value("os")
@@ -65,7 +67,7 @@ def call_testrunner(python_ver, buildnro):
_pExe, _env, env_pip, env_python = get_qtci_virtualEnv(python_ver, CI_HOST_OS, CI_HOST_ARCH, CI_TARGET_ARCH)
rmtree(_env, True)
# Pinning the virtualenv before creating one
- run_instruction(["pip", "install", "--user", "virtualenv==20.0.20"], "Failed to pin virtualenv")
+ run_instruction(["pip", "install", "--user", "virtualenv==20.0.25"], "Failed to pin virtualenv")
run_instruction(["virtualenv", "-p", _pExe, _env], "Failed to create virtualenv")
# When the 'python_ver' variable is empty, we are using Python 2
# Pip is always upgraded when CI template is provisioned, upgrading it in later phase may cause perm issue
diff --git a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
index 829e38551..bac210ba7 100644
--- a/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
+++ b/sources/pyside2/PySide2/QtCore/typesystem_core_common.xml
@@ -1477,9 +1477,15 @@
<enum-type name="IteratorFlag" flags="IteratorFlags"/>
</object-type>
<object-type name="QThread">
+ <inject-code file="../glue/qtcore.cpp" class="native" position="beginning" snippet="qthread_pthread_cleanup"/>
<enum-type name="Priority"/>
<modify-function signature="currentThreadId()" remove="all"/>
- <modify-function signature="run()" allow-thread="yes"/>
+ <modify-function signature="run()" allow-thread="yes">
+ <inject-code file="../glue/qtcore.cpp" class="native" position="beginning"
+ snippet="qthread_pthread_cleanup_install"/>
+ <inject-code file="../glue/qtcore.cpp" class="native" position="end"
+ snippet="qthread_pthread_cleanup_uninstall"/>
+ </modify-function>
<modify-function signature="exec()" rename="exec_" allow-thread="yes"/>
<modify-function signature="msleep(unsigned long)" allow-thread="yes"/>
<modify-function signature="sleep(unsigned long)" allow-thread="yes"/>
diff --git a/sources/pyside2/PySide2/glue/qtcore.cpp b/sources/pyside2/PySide2/glue/qtcore.cpp
index 8bd2baac1..f941d5cfc 100644
--- a/sources/pyside2/PySide2/glue/qtcore.cpp
+++ b/sources/pyside2/PySide2/glue/qtcore.cpp
@@ -1984,3 +1984,31 @@ PyTuple_SET_ITEM(%out, 0, %CONVERTTOPYTHON[%INTYPE_0](%in.first));
PyTuple_SET_ITEM(%out, 1, %CONVERTTOPYTHON[%INTYPE_1](%in.second));
return %out;
// @snippet return-qpair
+
+// @snippet qthread_pthread_cleanup
+#ifdef Q_OS_UNIX
+# include <stdio.h>
+# include <pthread.h>
+static void qthread_pthread_cleanup(void *arg)
+{
+ // PYSIDE 1282: When terminating a thread using QThread::terminate()
+ // (pthread_cancel()), QThread::run() is aborted and the lock is released,
+ // but ~GilState() is still executed for some reason. Prevent it from
+ // releasing.
+ auto gil = reinterpret_cast<Shiboken::GilState *>(arg);
+ gil->abandon();
+}
+#endif // Q_OS_UNIX
+// @snippet qthread_pthread_cleanup
+
+// @snippet qthread_pthread_cleanup_install
+#ifdef Q_OS_UNIX
+pthread_cleanup_push(qthread_pthread_cleanup, &gil);
+#endif
+// @snippet qthread_pthread_cleanup_install
+
+// @snippet qthread_pthread_cleanup_uninstall
+#ifdef Q_OS_UNIX
+pthread_cleanup_pop(0);
+#endif
+// @snippet qthread_pthread_cleanup_uninstall
diff --git a/sources/shiboken2/libshiboken/gilstate.cpp b/sources/shiboken2/libshiboken/gilstate.cpp
index a59c6f01e..76a4d0e61 100644
--- a/sources/shiboken2/libshiboken/gilstate.cpp
+++ b/sources/shiboken2/libshiboken/gilstate.cpp
@@ -63,5 +63,12 @@ void GilState::release()
}
}
+// Abandon the lock: Only for special situations, like termination of a
+// POSIX thread (PYSIDE 1282).
+void GilState::abandon()
+{
+ m_locked = false;
+}
+
} // namespace Shiboken
diff --git a/sources/shiboken2/libshiboken/gilstate.h b/sources/shiboken2/libshiboken/gilstate.h
index d22f688ba..fbf39ead0 100644
--- a/sources/shiboken2/libshiboken/gilstate.h
+++ b/sources/shiboken2/libshiboken/gilstate.h
@@ -57,6 +57,7 @@ public:
GilState();
~GilState();
void release();
+ void abandon();
private:
PyGILState_STATE m_gstate;
bool m_locked = false;