Name threads

This commit is contained in:
Atlante45 2015-01-31 00:50:12 -08:00
parent e73a000bb8
commit 1cfd98b2d7
8 changed files with 11 additions and 1 deletions

View file

@ -648,6 +648,7 @@ void AudioMixer::run() {
// setup a QThread with us as parent that will house the AudioMixerDatagramProcessor
_datagramProcessingThread = new QThread(this);
_datagramProcessingThread->setObjectName("Datagram Processor Thread");
// create an AudioMixerDatagramProcessor and move it to that thread
AudioMixerDatagramProcessor* datagramProcessor = new AudioMixerDatagramProcessor(nodeList->getNodeSocket(), thread());

View file

@ -879,6 +879,7 @@ void OctreeServer::setupDatagramProcessingThread() {
// setup a QThread with us as parent that will house the OctreeServerDatagramProcessor
_datagramProcessingThread = new QThread(this);
_datagramProcessingThread->setObjectName("Octree Datagram Processor");
// create an OctreeServerDatagramProcessor and move it to that thread
OctreeServerDatagramProcessor* datagramProcessor = new OctreeServerDatagramProcessor(nodeList->getNodeSocket(), thread());

View file

@ -281,6 +281,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
_runningScriptsWidget = new RunningScriptsWidget(_window);
// start the nodeThread so its event loop is running
_nodeThread->setObjectName("Datagram Processor Thread");
_nodeThread->start();
// make sure the node thread is given highest priority
@ -295,6 +296,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
// put the audio processing on a separate thread
QThread* audioThread = new QThread(this);
audioThread->setObjectName("Audio Thread");
auto audioIO = DependencyManager::get<Audio>();
audioIO->moveToThread(audioThread);
@ -452,7 +454,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
loadSettings();
int SAVE_SETTINGS_INTERVAL = 10 * MSECS_PER_SECOND; // Let's save every seconds for now
connect(&_settingsTimer, &QTimer::timeout, this, &Application::saveSettings);
connect(&_settingsThread, SIGNAL(started), &_settingsTimer, SLOT(start));
connect(&_settingsThread, SIGNAL(started()), &_settingsTimer, SLOT(start()));
connect(&_settingsThread, &QThread::finished, &_settingsTimer, &QTimer::deleteLater);
_settingsTimer.moveToThread(&_settingsThread);
_settingsTimer.setSingleShot(false);
@ -3491,6 +3493,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri
#endif
QThread* workerThread = new QThread(this);
workerThread->setObjectName("Script Engine Thread");
// when the worker thread is started, call our engine's run..
connect(workerThread, &QThread::started, scriptEngine, &ScriptEngine::run);

View file

@ -76,6 +76,7 @@ namespace SettingHandles {
void ModelUploader::uploadModel(ModelType modelType) {
ModelUploader* uploader = new ModelUploader(modelType);
QThread* thread = new QThread();
thread->setObjectName("Model Uploader");
thread->connect(uploader, SIGNAL(destroyed()), SLOT(quit()));
thread->connect(thread, SIGNAL(finished()), SLOT(deleteLater()));
uploader->connect(thread, SIGNAL(started()), SLOT(send()));

View file

@ -85,6 +85,7 @@ ModelsBrowser::ModelsBrowser(ModelType modelsType, QWidget* parent) :
// Setup and launch update thread
QThread* thread = new QThread();
thread->setObjectName("Models Browser");
thread->connect(_handler, SIGNAL(destroyed()), SLOT(quit()));
thread->connect(thread, SIGNAL(finished()), SLOT(deleteLater()));
_handler->moveToThread(thread);

View file

@ -53,6 +53,7 @@ AudioInjector* AudioScriptingInterface::playSound(Sound* sound, const AudioInjec
injector->setLocalAudioInterface(_localAudioInterface);
QThread* injectorThread = new QThread();
injectorThread->setObjectName("Audio Injector Thread");
injector->moveToThread(injectorThread);

View file

@ -166,6 +166,7 @@ void Player::pausePlayer() {
void Player::setupAudioThread() {
_audioThread = new QThread();
_audioThread->setObjectName("Player Audio Thread");
_options.position = _avatar->getPosition();
_options.orientation = _avatar->getOrientation();
_injector.reset(new AudioInjector(_recording->getAudioData(), _options), &QObject::deleteLater);

View file

@ -497,6 +497,7 @@ void AccountManager::requestProfileError(QNetworkReply::NetworkError error) {
void AccountManager::generateNewKeypair() {
// setup a new QThread to generate the keypair on, in case it takes a while
QThread* generateThread = new QThread(this);
generateThread->setObjectName("Account Manager Generator Thread");
// setup a keypair generator
RSAKeypairGenerator* keypairGenerator = new RSAKeypairGenerator();