mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Fixed wait check in device online/offline
This commit is contained in:
@@ -15,27 +15,6 @@ void EventManager::ResetInstance() {
|
||||
singleton = std::unique_ptr<EventManager>(new EventManager());
|
||||
}
|
||||
|
||||
// If this thread is not in the map, add it to be ignored
|
||||
// If it is, set it to be ignored
|
||||
void EventManager::downgradeErrorsOnCurrentThread() {
|
||||
std::lock_guard<std::mutex> lk(downgradedThreadsMutex);
|
||||
auto i = downgradedThreads.find(std::this_thread::get_id());
|
||||
if(i != downgradedThreads.end()) {
|
||||
i->second = true;
|
||||
} else {
|
||||
downgradedThreads.insert({std::this_thread::get_id(), true});
|
||||
}
|
||||
}
|
||||
|
||||
// If this thread exists in the map, turn off downgrading
|
||||
void EventManager::cancelErrorDowngradingOnCurrentThread() {
|
||||
std::lock_guard<std::mutex> lk(downgradedThreadsMutex);
|
||||
auto i = downgradedThreads.find(std::this_thread::get_id());
|
||||
if(i != downgradedThreads.end()) {
|
||||
i->second = false;
|
||||
}
|
||||
}
|
||||
|
||||
int EventManager::addEventCallback(const EventCallback &cb) {
|
||||
std::lock_guard<std::mutex> lk(callbacksMutex);
|
||||
callbacks.insert({callbackID, cb});
|
||||
|
||||
Reference in New Issue
Block a user