Run the present thread at highest priority

This commit is contained in:
Brad Davis 2016-02-08 23:53:30 -08:00
parent 6a66d74e19
commit 2b127720f8

View file

@ -28,6 +28,11 @@
#include <GLMHelpers.h>
#if THREADED_PRESENT
// FIXME, for display plugins that don't block on something like vsync, just
// cap the present rate at 200
// const static unsigned int MAX_PRESENT_RATE = 200;
class PresentThread : public QThread, public Dependency {
using Mutex = std::mutex;
using Condition = std::condition_variable;
@ -66,8 +71,10 @@ public:
_context->moveToThread(this);
}
virtual void run() override {
OpenGLDisplayPlugin* currentPlugin{ nullptr };
thread()->setPriority(QThread::HighestPriority);
Q_ASSERT(_context);
while (!_shutdown) {
if (_pendingMainThreadOperation) {
@ -450,4 +457,4 @@ void OpenGLDisplayPlugin::enableDeactivate() {
_uncustomized = true;
_deactivateWait.notify_one();
}
#endif
#endif