mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
Device: Add mutex for disk info requests to temporarily work around WiVIClient timeout issues
This commit is contained in:
committed by
Paul Hollinsky
parent
c2de1dfdf1
commit
44ad06d4bb
@@ -528,6 +528,9 @@ optional<bool> Device::isLogicalDiskConnected() {
|
|||||||
return nullopt;
|
return nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This doesn't *really* make sense here but because the disk read redirects the parser until it is done, we'll lock this
|
||||||
|
// just to avoid the timeout.
|
||||||
|
std::lock_guard<std::mutex> lg(diskLock);
|
||||||
const auto info = com->getLogicalDiskInfoSync();
|
const auto info = com->getLogicalDiskInfoSync();
|
||||||
if (!info) {
|
if (!info) {
|
||||||
report(APIEvent::Type::Timeout, APIEvent::Severity::Error);
|
report(APIEvent::Type::Timeout, APIEvent::Severity::Error);
|
||||||
@@ -543,6 +546,9 @@ optional<uint64_t> Device::getLogicalDiskSize() {
|
|||||||
return nullopt;
|
return nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This doesn't *really* make sense here but because the disk read redirects the parser until it is done, we'll lock this
|
||||||
|
// just to avoid the timeout.
|
||||||
|
std::lock_guard<std::mutex> lg(diskLock);
|
||||||
const auto info = com->getLogicalDiskInfoSync();
|
const auto info = com->getLogicalDiskInfoSync();
|
||||||
if (!info) {
|
if (!info) {
|
||||||
report(APIEvent::Type::Timeout, APIEvent::Severity::Error);
|
report(APIEvent::Type::Timeout, APIEvent::Severity::Error);
|
||||||
|
|||||||
Reference in New Issue
Block a user