Commit 0e13d458 authored by khalid's avatar khalid
Browse files

Mutex just before changing results map

parent 4a3ab705
......@@ -283,8 +283,7 @@ inline void process_file(taggedInputFile& input_file, std::unordered_map<std::st
kseq_destroy(sequence); // Destroy the seq object
gzclose(file);
// Transfer the results from the temp data structure to the full data structure
results_mutex.lock();
//CPM normalization
double nbreads = 0;
for (auto marker : temp_results) {
......@@ -292,9 +291,12 @@ inline void process_file(taggedInputFile& input_file, std::unordered_map<std::st
}
double permillion = nbreads/1000000;
// Transfer the results from the temp data structure to the full data structure
results_mutex.lock();
for (auto marker : temp_results) {
results[marker.first][input_file.individual_name] += round(marker.second / permillion);
results[marker.first][input_file.individual_name] += round(marker.second / permillion); //rounded CPM counts
}
results_mutex.unlock();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment