本文整理汇总了C++中ThreadPool::addThread方法的典型用法代码示例。如果您正苦于以下问题:C++ ThreadPool::addThread方法的具体用法?C++ ThreadPool::addThread怎么用?C++ ThreadPool::addThread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ThreadPool
的用法示例。
在下文中一共展示了ThreadPool::addThread方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
GenomeCopyNumber sampleCopyNumber;
sampleCopyNumber.setSamtools(pathToSamtools);
GenomeCopyNumber controlCopyNumber;
controlCopyNumber.setSamtools(pathToSamtools);
SNPinGenome snpingenome;
SNPinGenome snpingenomeControl;
string myNametmp = myName;
string myRealName;
int i = 0;
while ((myName[myName.size()-i]) != '/')
{
if (myNametmp[myNametmp.size()-i] != ' ')
{myRealName.push_back(myNametmp[myNametmp.size()-i]);}
i++;
}
myRealName = string(myRealName.rbegin(), myRealName.rend());
ThreadPoolManager* thrPoolManager = ThreadPoolManager::getInstance();
ThreadPool* thrPool = NULL;
if (has_BAF) { //read the pileup files only once
GenomeCopyNumberReadMateFileArgWrapper* readMateFileArg;
cout << "..will use SNP positions from "<< SNPinfoFile << " to calculate BAF profiles\n";
thrPool = thrPoolManager->newThreadPool("GenomeCopyNumber_readMateFile");
snpingenome.readSNPs(SNPinfoFile);
if (is_sample_pileup && !has_sample_mateCopyNumberFile && has_window) {
std::cout << "avoid double pileup read: reading sample matefile\n";
readMateFileArg = new GenomeCopyNumberReadMateFileArgWrapper(snpingenome, sample_MateFile, sample_inputFormat, minimalTotalLetterCountPerPosition, minimalQualityPerPosition, sampleCopyNumber, chrLenFile, window, step);
thrPool->addThread(GenomeCopyNumber_readMateFile_wrapper, readMateFileArg);
sample_copyNumber_pileup_read = true;
} else {
readMateFileArg = new GenomeCopyNumberReadMateFileArgWrapper(snpingenome, sample_MateFile, sample_inputFormat, minimalTotalLetterCountPerPosition, minimalQualityPerPosition);
thrPool->addThread(GenomeCopyNumber_readMateFile_wrapper, readMateFileArg);
sample_copyNumber_pileup_read = false;
}
if (isControlIsPresent) {
snpingenomeControl.setSNPChr(snpingenome.getSNPChr());
if (is_control_pileup && !has_control_mateCopyNumberFile && has_window) {
std::cout << "avoid double pileup read: reading control matefile\n";
readMateFileArg = new GenomeCopyNumberReadMateFileArgWrapper(snpingenomeControl, control_MateFile, control_inputFormat, minimalTotalLetterCountPerPosition, minimalQualityPerPosition, controlCopyNumber, chrLenFile, window, step);
thrPool->addThread(GenomeCopyNumber_readMateFile_wrapper, readMateFileArg);
control_copyNumber_pileup_read = true;
} else {
readMateFileArg = new GenomeCopyNumberReadMateFileArgWrapper(snpingenomeControl, control_MateFile, control_inputFormat, minimalTotalLetterCountPerPosition, minimalQualityPerPosition);
thrPool->addThread(GenomeCopyNumber_readMateFile_wrapper, readMateFileArg);
control_copyNumber_pileup_read = false;
}
}
thrPool->run();
delete thrPool;
}
if((ifTargeted) && (window == 0) && (step == 0))
{
cout << "FREEC will work on exome sequencing data! \n";
if (has_sample_mateCopyNumberFile) {
sampleCopyNumber.readCopyNumber(sample_MateCopyNumberFile);