From 630774460c480494d7ce66a0f91d49da60403ef4 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Sun, 22 Mar 2020 11:50:55 +0100 Subject: Minor tweaks --- src/dotrunner.cpp | 22 +++++++++++----------- 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 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(&DotWorkerThread::run, this); +} + +void DotWorkerThread::start() +{ + assert(!m_thread); + m_thread = std::make_unique(&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()); -- cgit v0.12