mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Device: Make IO system thread-safe
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user