diff options
Diffstat (limited to 'AnvilStats/Processor.cpp')
-rw-r--r-- | AnvilStats/Processor.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/AnvilStats/Processor.cpp b/AnvilStats/Processor.cpp index 2f6f2d860..02070a8fc 100644 --- a/AnvilStats/Processor.cpp +++ b/AnvilStats/Processor.cpp @@ -326,10 +326,18 @@ bool cProcessor::cThread::ProcessChunkSections(int a_ChunkX, int a_ChunkZ, cPars {
if (!SectionProcessed[y])
{
- m_Callback.OnEmptySection(y);
+ if (m_Callback.OnEmptySection(y))
+ {
+ return true;
+ }
}
}
+ if (m_Callback.OnSectionsFinished())
+ {
+ return true;
+ }
+
return false;
}
@@ -498,6 +506,14 @@ void cProcessor::ProcessWorld(const AString & a_WorldFolder, cCallbackFactory & // 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;
+
+ /*
+ // Limit the number of threads in DEBUG mode to 1 for easier debugging
+ #ifdef _DEBUG
+ NumThreads = 1;
+ #endif // _DEBUG
+ */
+
for (int i = 0; i < NumThreads; i++)
{
cCallback * Callback = a_CallbackFactory.GetNewCallback();
|