[brlcad-commits] SF.net SVN: brlcad:[38688]
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <dav...@us...> - 2010-04-21 14:51:21
|
Revision: 38688 http://brlcad.svn.sourceforge.net/brlcad/?rev=38688&view=rev Author: davidloman Date: 2010-04-21 14:51:14 +0000 (Wed, 21 Apr 2010) Log Message: ----------- Couple of simple mods to Job Management system. JM now works. Modified Paths: -------------- rt^3/trunk/src/libJob/JobManager.cxx rt^3/trunk/src/libJob/JobWorker.cxx rt^3/trunk/src/libJob/PrintToStdOutJob.cxx Modified: rt^3/trunk/src/libJob/JobManager.cxx =================================================================== --- rt^3/trunk/src/libJob/JobManager.cxx 2010-04-21 14:49:39 UTC (rev 38687) +++ rt^3/trunk/src/libJob/JobManager.cxx 2010-04-21 14:51:14 UTC (rev 38688) @@ -37,7 +37,8 @@ this->jobWorkers = new QList<JobWorker*> (); - QString text = "MAX_JOBWORKERS: " + QString::number(MAX_JOBWORKERS); + QString text = "Startup. MAX_JOBWORKERS: " + QString::number( + MAX_JOBWORKERS); this->log->logINFO("JobManager", text); @@ -46,8 +47,8 @@ this->jobWorkers->append(jw); jw->start(); - std::cout << "Created new JobWorker with ID of " - << jw->getWorkerIdAsStdString() << std::endl; + text = "Created new JobWorker with ID of " + jw->getWorkerIdAsQString(); + this->log->logINFO("JobManager", text); } } @@ -57,7 +58,6 @@ //TODO Should I loop through jobs, destroying them as well? delete queueLock; - //loop through workers while (!this->jobWorkers->isEmpty()) { JobWorker* jw = this->jobWorkers->front(); Modified: rt^3/trunk/src/libJob/JobWorker.cxx =================================================================== --- rt^3/trunk/src/libJob/JobWorker.cxx 2010-04-21 14:49:39 UTC (rev 38687) +++ rt^3/trunk/src/libJob/JobWorker.cxx 2010-04-21 14:51:14 UTC (rev 38688) @@ -57,9 +57,9 @@ continue; } - std::cout << "JobWorker (" << this->getWorkerIdAsStdString() - << ") is working Job with ID of " << job->getJobId() - << std::endl; + QString text = "JobWorker " + this->getWorkerIdAsQString() + + " is working Job with ID of " + job->getJobId(); + this->log->logINFO("JobWorker", text); JobResult result = job->doJob(); @@ -93,8 +93,8 @@ void JobWorker::shutdown() { this->runCmd = false; - QString text = "JobWorker (" + this->getWorkerIdAsQString() - + ") received Shutdown Command."; + QString text = "JobWorker " + this->getWorkerIdAsQString() + + " received Shutdown Command."; this->log->logINFO("JobWorker", text); } Modified: rt^3/trunk/src/libJob/PrintToStdOutJob.cxx =================================================================== --- rt^3/trunk/src/libJob/PrintToStdOutJob.cxx 2010-04-21 14:49:39 UTC (rev 38687) +++ rt^3/trunk/src/libJob/PrintToStdOutJob.cxx 2010-04-21 14:51:14 UTC (rev 38688) @@ -23,6 +23,7 @@ #include "libJob/PrintToStdOutJob.h" #include <iostream> +#include "utility/ThreadUtils.h" PrintToStdOutJob::PrintToStdOutJob(QString text) { @@ -37,9 +38,12 @@ JobResult PrintToStdOutJob::_doJob() { + + ThreadUtils::sleep(1); + QMutexLocker(this->streamLock); - std::cout << text.toStdString(); + std::cout << "JobID:" << this->jobID << " Text: "<< text.toStdString(); return JOB_COMPLETED_NO_ERRORS; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |