Added message callback functionality in c and canceled error downgrading on user callbacks in communication as well

This commit is contained in:
EricLiu2000
2019-07-30 10:22:27 -04:00
parent 5a98bac8a6
commit c10224002a
3 changed files with 17 additions and 4 deletions
+3
View File
@@ -156,11 +156,14 @@ 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
cb.second.callIfMatch(msg);
}
}
EventManager::GetInstance().downgradeErrorsOnCurrentThread();
}
}
}