Skip to content

Commit

Permalink
Use std::thread so we don't have to use another Qt module
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertBColton committed Mar 7, 2020
1 parent 2374a81 commit acffbad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Plugins/ServerPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#include <QList>
#include <QTemporaryFile>
#include <QTimer>
#include <QtConcurrent>

#include <thread>
#include <memory>

namespace {
Expand Down Expand Up @@ -131,7 +131,7 @@ CompilerClient::~CompilerClient() {}

CompilerClient::CompilerClient(std::shared_ptr<Channel> channel, MainWindow& mainWindow)
: QObject(&mainWindow), stub(Compiler::NewStub(channel)), mainWindow(mainWindow) {
QtConcurrent::run([this](){
std::thread([this](){
while(true) {
void* got_tag = nullptr;
bool ok = false;
Expand All @@ -140,7 +140,7 @@ CompilerClient::CompilerClient(std::shared_ptr<Channel> channel, MainWindow& mai
QMetaObject::invokeMethod(this, "UpdateLoop", Qt::BlockingQueuedConnection,
Q_ARG(void*, got_tag), Q_ARG(bool, ok));
}
});
}).detach();
}

void CompilerClient::CompileBuffer(Game* game, CompileMode mode, std::string name) {
Expand Down
2 changes: 1 addition & 1 deletion RadialGM.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
#-------------------------------------------------

QT += core concurrent gui printsupport multimedia testlib
QT += core gui printsupport multimedia testlib
CONFIG += c++11

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
Expand Down

0 comments on commit acffbad

Please sign in to comment.