@@ -593,8 +593,8 @@ bool CarlaEngine::init(const char* const clientName) | |||||
kData->nextAction.ready(); | kData->nextAction.ready(); | ||||
kData->thread.startNow(); | kData->thread.startNow(); | ||||
if (type() == kEngineTypePlugin) | |||||
kData->thread.waitForStarted(); | |||||
//if (type() == kEngineTypePlugin) | |||||
// kData->thread.waitForStarted(); | |||||
return true; | return true; | ||||
} | } | ||||
@@ -60,7 +60,7 @@ void CarlaEngineThread::stopNow() | |||||
const CarlaMutex::ScopedLocker sl(&fMutex); | const CarlaMutex::ScopedLocker sl(&fMutex); | ||||
if (isRunning() && ! stop(500)) | |||||
if (isRunning() && ! wait(500)) | |||||
terminate(); | terminate(); | ||||
} | } | ||||
@@ -20,7 +20,9 @@ | |||||
#include "CarlaBackend.hpp" | #include "CarlaBackend.hpp" | ||||
#include "CarlaMutex.hpp" | #include "CarlaMutex.hpp" | ||||
#include "CarlaThread.hpp" | |||||
//#include "CarlaThread.hpp" | |||||
#include <QtCore/QThread> | |||||
CARLA_BACKEND_START_NAMESPACE | CARLA_BACKEND_START_NAMESPACE | ||||
@@ -28,7 +30,7 @@ CARLA_BACKEND_START_NAMESPACE | |||||
} // Fix editor indentation | } // Fix editor indentation | ||||
#endif | #endif | ||||
class CarlaEngineThread : public CarlaThread | |||||
class CarlaEngineThread : public QThread | |||||
{ | { | ||||
public: | public: | ||||
CarlaEngineThread(CarlaEngine* const engine); | CarlaEngineThread(CarlaEngine* const engine); | ||||
@@ -22,9 +22,11 @@ | |||||
#include "CarlaNative.hpp" | #include "CarlaNative.hpp" | ||||
#include "CarlaMIDI.h" | #include "CarlaMIDI.h" | ||||
#include "CarlaString.hpp" | #include "CarlaString.hpp" | ||||
#include "CarlaThread.hpp" | |||||
//#include "CarlaThread.hpp" | |||||
#include "RtList.hpp" | #include "RtList.hpp" | ||||
#include <QtCore/QThread> | |||||
#include "zynaddsubfx/Misc/Master.h" | #include "zynaddsubfx/Misc/Master.h" | ||||
#include "zynaddsubfx/Misc/Util.h" | #include "zynaddsubfx/Misc/Util.h" | ||||
@@ -94,7 +96,7 @@ public: | |||||
{ | { | ||||
fThread.start(); | fThread.start(); | ||||
maybeInitPrograms(kMaster); | maybeInitPrograms(kMaster); | ||||
fThread.waitForStarted(); | |||||
//fThread.waitForStarted(); | |||||
} | } | ||||
~ZynAddSubFxPlugin() | ~ZynAddSubFxPlugin() | ||||
@@ -329,7 +331,7 @@ private: | |||||
ProgramInfo(const ProgramInfo&) = delete; | ProgramInfo(const ProgramInfo&) = delete; | ||||
}; | }; | ||||
class ZynThread : public CarlaThread | |||||
class ZynThread : public QThread | |||||
{ | { | ||||
public: | public: | ||||
ZynThread(Master* const master, const HostDescriptor* const host) | ZynThread(Master* const master, const HostDescriptor* const host) | ||||
@@ -371,7 +373,7 @@ private: | |||||
void stop() | void stop() | ||||
{ | { | ||||
fQuit = true; | fQuit = true; | ||||
CarlaThread::stop(); | |||||
quit(); | |||||
} | } | ||||
#ifdef WANT_ZYNADDSUBFX_UI | #ifdef WANT_ZYNADDSUBFX_UI | ||||
@@ -150,7 +150,7 @@ public: | |||||
kData->osc.data.free(); | kData->osc.data.free(); | ||||
// Wait a bit first, then force kill | // Wait a bit first, then force kill | ||||
if (kData->osc.thread.isRunning() && ! kData->osc.thread.stop(1000)) // kData->engine->getOptions().oscUiTimeout | |||||
if (kData->osc.thread.isRunning() && ! kData->osc.thread.wait(1000)) // kData->engine->getOptions().oscUiTimeout | |||||
{ | { | ||||
carla_stderr("Failed to properly stop Plugin Bridge thread"); | carla_stderr("Failed to properly stop Plugin Bridge thread"); | ||||
kData->osc.thread.terminate(); | kData->osc.thread.terminate(); | ||||
@@ -1242,7 +1242,7 @@ public: | |||||
kData->osc.thread.setOscData(bridgeBinary, label, getPluginTypeAsString(fPluginType), shmIdStr); | kData->osc.thread.setOscData(bridgeBinary, label, getPluginTypeAsString(fPluginType), shmIdStr); | ||||
kData->osc.thread.start(); | kData->osc.thread.start(); | ||||
kData->osc.thread.waitForStarted(); | |||||
//kData->osc.thread.waitForStarted(); | |||||
} | } | ||||
for (int i=0; i < 200; i++) | for (int i=0; i < 200; i++) | ||||
@@ -1268,7 +1268,7 @@ public: | |||||
// unregister so it gets handled properly | // unregister so it gets handled properly | ||||
registerEnginePlugin(kData->engine, fId, nullptr); | registerEnginePlugin(kData->engine, fId, nullptr); | ||||
kData->osc.thread.stop(); | |||||
kData->osc.thread.quit(); | |||||
// last error was set before | // last error was set before | ||||
return false; | return false; | ||||
} | } | ||||
@@ -20,13 +20,15 @@ | |||||
#include "CarlaBackend.hpp" | #include "CarlaBackend.hpp" | ||||
#include "CarlaString.hpp" | #include "CarlaString.hpp" | ||||
#include "CarlaThread.hpp" | |||||
//#include "CarlaThread.hpp" | |||||
#include <QtCore/QThread> | |||||
class QProcess; | class QProcess; | ||||
CARLA_BACKEND_START_NAMESPACE | CARLA_BACKEND_START_NAMESPACE | ||||
class CarlaPluginThread : public CarlaThread | |||||
class CarlaPluginThread : public QThread | |||||
{ | { | ||||
public: | public: | ||||
enum Mode { | enum Mode { | ||||
@@ -57,7 +57,7 @@ public: | |||||
showGui(false); | showGui(false); | ||||
// Wait a bit first, then force kill | // Wait a bit first, then force kill | ||||
if (kData->osc.thread.isRunning() && ! kData->osc.thread.stop(kData->engine->getOptions().oscUiTimeout)) | |||||
if (kData->osc.thread.isRunning() && ! kData->osc.thread.wait(kData->engine->getOptions().oscUiTimeout)) | |||||
{ | { | ||||
carla_stderr("DSSI GUI thread still running, forcing termination now"); | carla_stderr("DSSI GUI thread still running, forcing termination now"); | ||||
kData->osc.thread.terminate(); | kData->osc.thread.terminate(); | ||||
@@ -357,7 +357,7 @@ public: | |||||
kData->osc.data.free(); | kData->osc.data.free(); | ||||
} | } | ||||
if (kData->osc.thread.isRunning() && ! kData->osc.thread.stop(kData->engine->getOptions().oscUiTimeout)) | |||||
if (kData->osc.thread.isRunning() && ! kData->osc.thread.wait(kData->engine->getOptions().oscUiTimeout)) | |||||
kData->osc.thread.terminate(); | kData->osc.thread.terminate(); | ||||
} | } | ||||
} | } | ||||
@@ -86,7 +86,7 @@ public: | |||||
if (fGui.isOsc) | if (fGui.isOsc) | ||||
{ | { | ||||
// Wait a bit first, then force kill | // Wait a bit first, then force kill | ||||
if (kData->osc.thread.isRunning() && ! kData->osc.thread.stop(kData->engine->getOptions().oscUiTimeout)) | |||||
if (kData->osc.thread.isRunning() && ! kData->osc.thread.wait(kData->engine->getOptions().oscUiTimeout)) | |||||
{ | { | ||||
carla_stderr("VST GUI thread still running, forcing termination now"); | carla_stderr("VST GUI thread still running, forcing termination now"); | ||||
kData->osc.thread.terminate(); | kData->osc.thread.terminate(); | ||||
@@ -352,7 +352,7 @@ public: | |||||
kData->osc.data.free(); | kData->osc.data.free(); | ||||
} | } | ||||
if (kData->osc.thread.isRunning() && ! kData->osc.thread.stop(kData->engine->getOptions().oscUiTimeout)) | |||||
if (kData->osc.thread.isRunning() && ! kData->osc.thread.wait(kData->engine->getOptions().oscUiTimeout)) | |||||
kData->osc.thread.terminate(); | kData->osc.thread.terminate(); | ||||
} | } | ||||
} | } | ||||
@@ -20,6 +20,8 @@ | |||||
#include "CarlaJuceUtils.hpp" | #include "CarlaJuceUtils.hpp" | ||||
#error This class is not ready for usage yet | |||||
// #define CPP11_THREAD | // #define CPP11_THREAD | ||||
#ifdef CPP11_THREAD | #ifdef CPP11_THREAD | ||||