remove unneccesary mutex lock aand unlock for read only operations

This commit is contained in:
Ryan Tang 2024-08-19 12:27:51 -04:00
parent 36621dcf31
commit e13db06ed3
2 changed files with 4 additions and 4 deletions

View File

@ -319,7 +319,7 @@ void SingleSpectra::FillHistograms(){
// qDebug() << randomChList;
digiMTX[ID].lock();
// digiMTX[ID].lock();
// digi[ID]->GetData()->PrintAllData();
@ -368,7 +368,7 @@ void SingleSpectra::FillHistograms(){
}
if( hist2DVisibility[ID] ) hist2D[ID]->UpdatePlot();
digiMTX[ID].unlock();
// digiMTX[ID].unlock();
}
}

View File

@ -94,13 +94,13 @@ void Analyzer::BuildEvents(bool verbose){
unsigned int nData = mb->GetNumOfDigitizer();
std::vector<int> idList = mb->GetDigiIDList();
for( unsigned int i = 0; i < nData; i++ ) digiMTX[idList[i]].lock();
// for( unsigned int i = 0; i < nData; i++ ) digiMTX[idList[i]].lock();
if( isBuildBackward ){
mb->BuildEventsBackWard(maxNumEventBuilt, verbose);
}else{
mb->BuildEvents(0, true, verbose);
}
for( unsigned int i = 0; i < nData; i++ ) digiMTX[idList[i]].unlock();
// for( unsigned int i = 0; i < nData; i++ ) digiMTX[idList[i]].unlock();
}