Commit 7be4d5d9 authored by EYRAUD-DUBOIS Lionel's avatar EYRAUD-DUBOIS Lionel

Bugfix for computing sorted task types

parent fb6304cd
......@@ -23,6 +23,8 @@ Instance::Instance() {
Instance::Instance(const string input_file, int convertIndices) {
// cout << "Opening " << input_file << "..." << endl;
sortedByLength = nullptr;
this->inputFile = input_file;
ifstream input(input_file);
int i;
......@@ -503,8 +505,10 @@ void Instance::computeRevDependencies() {
}
std::vector<std::vector<int> > *Instance::getSortedByLength() {
if(sortedByLength == NULL) {
sortedByLength= new vector<vector<int> >(nbWorkerTypes);
lock_guard<mutex> lock(mtx);
if(sortedByLength == nullptr) {
sortedByLength = new vector<vector<int> >(nbWorkerTypes);
auto & result = *sortedByLength;
for (unsigned int i = 0; i < nbWorkerTypes; i++) {
for (int j = 0; j < nbTaskTypes; j++)
......
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