Implemented thread specific error-downgrading to events and wrote corresponding unit test

This commit is contained in:
EricLiu2000
2019-07-24 12:52:15 -04:00
parent 42a5d525ce
commit 6f8d307850
5 changed files with 87 additions and 4 deletions
+8
View File
@@ -15,6 +15,14 @@ void EventManager::ResetInstance() {
singleton = std::unique_ptr<EventManager>(new EventManager());
}
void EventManager::downgradeErrorsOnCurrentThread() {
downgradedThreads.insert(std::this_thread::get_id());
}
void EventManager::cancelErrorDowngradingOnCurrentThread() {
downgradedThreads.erase(std::this_thread::get_id());
}
void EventManager::get(std::vector<APIEvent>& eventOutput, size_t max, EventFilter filter) {
std::lock_guard<std::mutex> lk(mutex);