Reordered error downgrading, order of going offline, and renamed locks

This commit is contained in:
EricLiu2000
2019-08-06 10:32:19 -04:00
parent 01c62b6445
commit 3358241abe
5 changed files with 12 additions and 12 deletions
+4 -3
View File
@@ -156,14 +156,15 @@ void Communication::readTask() {
std::lock_guard<std::mutex> lk(messageCallbacksLock);
// We want callbacks to be able to access errors
EventManager::GetInstance().cancelErrorDowngradingOnCurrentThread();
for(auto& cb : messageCallbacks) {
if(!closing) { // We might have closed while reading or processing
// We want callbacks to be able to access errors
EventManager::GetInstance().cancelErrorDowngradingOnCurrentThread();
cb.second.callIfMatch(msg);
EventManager::GetInstance().downgradeErrorsOnCurrentThread();
}
}
EventManager::GetInstance().downgradeErrorsOnCurrentThread();
}
}
}