diff --git a/device/device.cpp b/device/device.cpp index 1513c36..9500f8c 100644 --- a/device/device.cpp +++ b/device/device.cpp @@ -528,6 +528,9 @@ optional Device::isLogicalDiskConnected() { 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 lg(diskLock); const auto info = com->getLogicalDiskInfoSync(); if (!info) { report(APIEvent::Type::Timeout, APIEvent::Severity::Error); @@ -543,6 +546,9 @@ optional Device::getLogicalDiskSize() { 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 lg(diskLock); const auto info = com->getLogicalDiskInfoSync(); if (!info) { report(APIEvent::Type::Timeout, APIEvent::Severity::Error);