Catched SQLITE_BUSY exception.

master
Miroslav Bendík 2014-02-23 09:50:34 +01:00
parent 7d15dbf4ed
commit a71f8ed9a6
1 changed files with 7 additions and 0 deletions

View File

@ -13,6 +13,7 @@
#include <gdfontmb.h>
#include <iostream>
#include <sstream>
#include <unistd.h>
#include "config.h"
#include "PlayerAttributes.h"
#include "TileGenerator.h"
@ -301,6 +302,9 @@ void TileGenerator::loadBlocks()
}
m_positions.push_back(std::pair<int, int>(pos.x, pos.z));
}
else if (result == SQLITE_BUSY) {
usleep(10000);
}
else {
break;
}
@ -613,6 +617,9 @@ std::map<int, TileGenerator::BlockList> TileGenerator::getBlocksOnZ(int zPos, sq
BlockPos pos = decodeBlockPos(blocknum);
blocks[pos.x].push_back(Block(pos, unsigned_string(data, size)));
}
else if (result == SQLITE_BUSY) {
usleep(10000);
}
else {
break;
}