mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-29 19:22:57 +02:00
Merge pull request #7557 from hyperlogic/tony/reset-thread-priority
ModelCache: reset thread priority back to normal
This commit is contained in:
commit
6660f0959b
1 changed files with 4 additions and 2 deletions
|
@ -10,6 +10,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "ModelCache.h"
|
#include "ModelCache.h"
|
||||||
|
#include <Finally.h>
|
||||||
#include <FSTReader.h>
|
#include <FSTReader.h>
|
||||||
#include "FBXReader.h"
|
#include "FBXReader.h"
|
||||||
#include "OBJReader.h"
|
#include "OBJReader.h"
|
||||||
|
@ -117,6 +118,9 @@ void GeometryReader::run() {
|
||||||
originalPriority = QThread::NormalPriority;
|
originalPriority = QThread::NormalPriority;
|
||||||
}
|
}
|
||||||
QThread::currentThread()->setPriority(QThread::LowPriority);
|
QThread::currentThread()->setPriority(QThread::LowPriority);
|
||||||
|
Finally setPriorityBackToNormal([originalPriority]() {
|
||||||
|
QThread::currentThread()->setPriority(originalPriority);
|
||||||
|
});
|
||||||
|
|
||||||
if (!_resource.data()) {
|
if (!_resource.data()) {
|
||||||
qCWarning(modelnetworking) << "Abandoning load of" << _url << "; resource was deleted";
|
qCWarning(modelnetworking) << "Abandoning load of" << _url << "; resource was deleted";
|
||||||
|
@ -167,8 +171,6 @@ void GeometryReader::run() {
|
||||||
QMetaObject::invokeMethod(resource.data(), "finishedLoading", Qt::BlockingQueuedConnection, Q_ARG(bool, false));
|
QMetaObject::invokeMethod(resource.data(), "finishedLoading", Qt::BlockingQueuedConnection, Q_ARG(bool, false));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QThread::currentThread()->setPriority(originalPriority);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class GeometryDefinitionResource : public GeometryResource {
|
class GeometryDefinitionResource : public GeometryResource {
|
||||||
|
|
Loading…
Reference in a new issue