Clang: Start ConnectionClient asynchronously

The connection client can block main thread at start up. This patch is
removing the wait functions and using signals instead.

Change-Id: I847c98b095752f6a875c0365bc27361bc5bdd051
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Marco Bubke
2016-07-11 13:44:02 +02:00
committed by Tim Jenssen
parent 2b08faab83
commit cda6e3c15a
4 changed files with 162 additions and 103 deletions

View File

@@ -331,12 +331,11 @@ void IpcCommunicator::initializeBackend()
m_connection.setProcessAliveTimerInterval(30 * 1000);
m_connection.setProcessPath(clangBackEndProcessPath);
connect(&m_connection, &ConnectionClient::processRestarted,
connect(&m_connection, &ConnectionClient::connectedToLocalSocket,
this, &IpcCommunicator::onBackendRestarted);
// TODO: Add a asynchron API to ConnectionClient, otherwise we might hang here
if (m_connection.connectToServer())
initializeBackendWithCurrentData();
m_connection.startProcessAndConnectToServerAsynchronously();
}
static QStringList projectPartOptions(const CppTools::ProjectPart::Ptr &projectPart)