diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-01-22 07:49:14 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-01-22 07:49:14 +0100 |
commit | 14763ed3c68bcf2a21e2494bc0d8920cc0ac1f62 (patch) | |
tree | 4fd68c617300791d37ddcbb7f9005fe680eb3b74 /AnvilStats/Processor.cpp | |
parent | Obsoleted E_BLOCK_COCA_PLANT in favor of E_BLOCK_COCOA_POD. (diff) | |
download | cuberite-14763ed3c68bcf2a21e2494bc0d8920cc0ac1f62.tar cuberite-14763ed3c68bcf2a21e2494bc0d8920cc0ac1f62.tar.gz cuberite-14763ed3c68bcf2a21e2494bc0d8920cc0ac1f62.tar.bz2 cuberite-14763ed3c68bcf2a21e2494bc0d8920cc0ac1f62.tar.lz cuberite-14763ed3c68bcf2a21e2494bc0d8920cc0ac1f62.tar.xz cuberite-14763ed3c68bcf2a21e2494bc0d8920cc0ac1f62.tar.zst cuberite-14763ed3c68bcf2a21e2494bc0d8920cc0ac1f62.zip |
Diffstat (limited to '')
-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();
|