Use more Utils::isMainThread()

Change-Id: Ia3c6f6dca53c5d7487b0813de16f06c52af47aa5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Jarek Kobus
2022-10-10 15:59:26 +02:00
parent 862a3923f4
commit f5f3bbcc59
13 changed files with 37 additions and 46 deletions

View File

@@ -35,6 +35,7 @@
#include <utils/qtcassert.h>
#include <utils/qtcprocess.h>
#include <utils/qtcsettings.h>
#include <utils/threadutils.h>
#ifdef WITH_TESTS
#include <utils/hostosinfo.h>
@@ -851,7 +852,7 @@ bool PluginManager::finishScenario()
// Waits until the running scenario is fully initialized
void PluginManager::waitForScenarioFullyInitialized()
{
if (QThread::currentThread() == qApp->thread()) {
if (isMainThread()) {
qWarning("The waitForScenarioFullyInitialized() function can't be called from main thread.");
return;
}
@@ -1378,7 +1379,7 @@ void PluginManagerPrivate::shutdown()
#ifdef WITH_TESTS
if (PluginManager::isScenarioRunning("TestModelManagerInterface")) {
qDebug() << "Point 2: Expect the next call to Point 3 triggers a crash";
QThread::currentThread()->sleep(5);
QThread::sleep(5);
}
#endif
if (!allObjects.isEmpty()) {