Port Thread* methods to boost::thread_group

This commit is contained in:
Gavin Andresen
2013-03-06 22:31:26 -05:00
parent 72f14d26ec
commit 21eb5adadb
10 changed files with 134 additions and 494 deletions

View File

@@ -1560,15 +1560,9 @@ bool FindUndoPos(CValidationState &state, int nFile, CDiskBlockPos &pos, unsigne
static CCheckQueue<CScriptCheck> scriptcheckqueue(128);
void ThreadScriptCheck(void*) {
vnThreadsRunning[THREAD_SCRIPTCHECK]++;
void ThreadScriptCheck() {
RenameThread("bitcoin-scriptch");
scriptcheckqueue.Thread();
vnThreadsRunning[THREAD_SCRIPTCHECK]--;
}
void ThreadScriptCheckQuit() {
scriptcheckqueue.Quit();
}
bool CBlock::ConnectBlock(CValidationState &state, CBlockIndex* pindex, CCoinsViewCache &view, bool fJustCheck)
@@ -2867,7 +2861,9 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
}
}
uint64 nRewind = blkdat.GetPos();
while (blkdat.good() && !blkdat.eof() && !fRequestShutdown) {
while (blkdat.good() && !blkdat.eof()) {
boost::this_thread::interruption_point();
blkdat.SetPos(nRewind);
nRewind++; // start one byte further next time, in case of failure
blkdat.SetLimit(); // remove former limit