MCPcopy Create free account
hub / github.com/OpenGene/fastplong / processorTask

Method processorTask

src/seprocessor.cpp:431–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429}
430
431void SingleEndProcessor::processorTask(ThreadConfig* config)
432{
433 SingleProducerSingleConsumerList<ReadPack*>* input = config->getInput();
434 while(true) {
435 if(config->canBeStopped()){
436 break;
437 }
438 while(input->canBeConsumed()) {
439 ReadPack* data = input->consume();
440 processSingleEnd(data, config);
441 }
442 if(input->isProducerFinished()) {
443 if(!input->canBeConsumed()) {
444 if(mOptions->verbose) {
445 string msg = "thread " + to_string(config->getThreadId() + 1) + " data processing completed";
446 loginfo(msg);
447 }
448 break;
449 }
450 } else {
451 usleep(100);
452 }
453 }
454 input->setConsumerFinished();
455
456 mFinishedThreads++;
457 if(mFinishedThreads == mOptions->thread) {
458 if(mLeftWriter)
459 mLeftWriter->setInputCompleted();
460 if(mFailedWriter)
461 mFailedWriter->setInputCompleted();
462 }
463
464 if(mOptions->verbose) {
465 string msg = "thread " + to_string(config->getThreadId() + 1) + " finished";
466 loginfo(msg);
467 }
468}
469
470void SingleEndProcessor::writerTask(WriterThread* config)
471{

Callers

nothing calls this directly

Calls 9

loginfoFunction · 0.85
getInputMethod · 0.80
canBeStoppedMethod · 0.80
canBeConsumedMethod · 0.80
consumeMethod · 0.80
isProducerFinishedMethod · 0.80
getThreadIdMethod · 0.80
setConsumerFinishedMethod · 0.80
setInputCompletedMethod · 0.80

Tested by

no test coverage detected