diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2020-03-22 10:50:55 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2020-03-22 10:50:55 (GMT) |
commit | 630774460c480494d7ce66a0f91d49da60403ef4 (patch) | |
tree | 7607762303805c40d1b42c5568efaf6a9cf1751a | |
parent | 739e9c039b6678b0565922f8a38e062cc83fd702 (diff) | |
download | Doxygen-630774460c480494d7ce66a0f91d49da60403ef4.zip Doxygen-630774460c480494d7ce66a0f91d49da60403ef4.tar.gz Doxygen-630774460c480494d7ce66a0f91d49da60403ef4.tar.bz2 |
Minor tweaks
-rw-r--r-- | src/dotrunner.cpp | 22 | ||||
-rw-r--r-- | src/dotrunner.h | 8 |
2 files changed, 14 insertions, 16 deletions
diff --git a/src/dotrunner.cpp b/src/dotrunner.cpp index db69b30..cb6bd73 100644 --- a/src/dotrunner.cpp +++ b/src/dotrunner.cpp @@ -170,7 +170,7 @@ void DotRunner::addJob(const char *format, const char *output) m_jobs.emplace_back(format, output, args); } -QCString getBaseNameOfOutput(QCString const& output) +QCString getBaseNameOfOutput(const QCString &output) { int index = output.findRev('.'); if (index < 0) return output; @@ -263,10 +263,10 @@ void DotRunnerQueue::enqueue(DotRunner *runner) DotRunner *DotRunnerQueue::dequeue() { std::unique_lock<std::mutex> locker(m_mutex); - - // wait until something is added to the queue - m_bufferNotEmpty.wait(locker, [this]() {return !m_queue.empty(); }); - + + // wait until something is added to the queue + m_bufferNotEmpty.wait(locker, [this]() { return !m_queue.empty(); }); + DotRunner *result = m_queue.front(); m_queue.pop(); return result; @@ -292,10 +292,10 @@ void DotWorkerThread::run() { runner->run(); } -}
-
-void DotWorkerThread::start()
-{
- assert(!m_thread);
- m_thread = std::make_unique<std::thread>(&DotWorkerThread::run, this);
+} + +void DotWorkerThread::start() +{ + assert(!m_thread); + m_thread = std::make_unique<std::thread>(&DotWorkerThread::run, this); } diff --git a/src/dotrunner.h b/src/dotrunner.h index 89eabf8..555ea78 100644 --- a/src/dotrunner.h +++ b/src/dotrunner.h @@ -28,18 +28,16 @@ /** Helper class to run dot from doxygen from multiple threads. */ class DotRunner { - public: struct DotJob { - DotJob(std::string format, - std::string output, - std::string args) - : format(std::move(format)), output(std::move(output)), args(std::move(args)) {} + DotJob(std::string f, std::string o, std::string a) + : format(f), output(o), args(a) {} std::string format; std::string output; std::string args; }; + public: /** Creates a runner for a dot \a file. */ DotRunner(const std::string& absDotName, const std::string& md5Hash = std::string()); |