1
0

AnvilStats: aborting calc for no input files.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@929 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2012-10-04 13:34:25 +00:00
parent 9e7cfac327
commit 88a97874b8

View File

@ -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");
}