From 712457fab6a7caad1ab245460c0170026ab91b10 Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Mon, 4 Dec 2017 11:05:50 +0100 Subject: JobQ: added BusyWorker counter and TotalJobsDone counter --- src/JobQueue.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/JobQueue.cpp') diff --git a/src/JobQueue.cpp b/src/JobQueue.cpp index af9a7e1..eb6320c 100644 --- a/src/JobQueue.cpp +++ b/src/JobQueue.cpp @@ -45,11 +45,17 @@ void WorkerThread::doJob() UpdateFactory uf; Job job = m_pQueue->Pop(); + m_pQueue->incBusyWorker(); + + /* process the job which was started by the GUI */ switch(job.m_cmd) { case Job::eID_THREAD_EXIT: + m_pQueue->decBusyWorker(); throw Job::eID_THREAD_EXIT; case Job::eID_THREAD_JOB: + Sleep(1000); /* give the UI some time to handle a lot of new Jobs */ + m_pQueue->Report(Job::eID_THREAD_MSG, wxString::Format(wxT("Job #%d: Connecting to %s:%i"), job.m_Arg.jobid, job.m_Arg.hostname, job.m_Arg.port), m_ID); @@ -122,4 +128,5 @@ void WorkerThread::doJob() default: break; } + m_pQueue->decBusyWorker(); } -- cgit v1.2.3