From 88a97874b863a7ab0ec5756547d55f183c2c109c Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 4 Oct 2012 13:34:25 +0000 Subject: AnvilStats: aborting calc for no input files. git-svn-id: http://mc-server.googlecode.com/svn/trunk@929 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- AnvilStats/Processor.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'AnvilStats') diff --git a/AnvilStats/Processor.cpp b/AnvilStats/Processor.cpp index 0d7c5d192..2f6f2d860 100644 --- a/AnvilStats/Processor.cpp +++ b/AnvilStats/Processor.cpp @@ -489,6 +489,12 @@ void cProcessor::ProcessWorld(const AString & a_WorldFolder, cCallbackFactory & { PopulateFileQueue(a_WorldFolder); + if (m_FileQueue.empty()) + { + LOG("No files to process, exitting."); + return; + } + // Start as many threads as there are cores, plus one: // (One more thread can be in the file-read IO block while all other threads crunch the numbers) int NumThreads = GetNumCores() + 1; @@ -503,10 +509,12 @@ void cProcessor::ProcessWorld(const AString & a_WorldFolder, cCallbackFactory & // Wait for all threads to finish // simply by calling each thread's destructor sequentially + LOG("Waiting for threads to finish"); for (cThreads::iterator itr = m_Threads.begin(), end = m_Threads.end(); itr != end; ++itr) { delete *itr; } // for itr - m_Threads[] + LOG("Processor finished"); } -- cgit v1.2.3