Device: Make IO system thread-safe

This commit is contained in:
Paul Hollinsky
2021-04-21 10:04:25 -04:00
parent 3b6b4f0541
commit 92589c2ce7
8 changed files with 10 additions and 0 deletions
+2
View File
@@ -432,6 +432,7 @@ optional<bool> Device::getDigitalIO(IO type, size_t number /* = 1 */) {
return false;
}
std::lock_guard<std::mutex> lk(ioMutex);
switch(type) {
case IO::EthernetActivation:
if(getEthernetActivationLineCount() < number)
@@ -481,6 +482,7 @@ bool Device::setDigitalIO(IO type, size_t number, bool value) {
return false;
}
std::lock_guard<std::mutex> lk(ioMutex);
switch(type) {
case IO::EthernetActivation:
if(getEthernetActivationLineCount() < number)