Device: Don't try to deduce lock_guard template parameters

This improves compatibility with older C++ standards
v0.3.0-dev
Paul Hollinsky 2022-02-14 19:32:12 -05:00
parent 4fd65d85c8
commit 44e48182bf
1 changed files with 3 additions and 3 deletions

View File

@ -254,7 +254,7 @@ bool Device::open(OpenFlags flags, OpenStatusHandler handler) {
// otherwise quiet stream. This lock makes sure suppressDisconnects() will // otherwise quiet stream. This lock makes sure suppressDisconnects() will
// block until we've either gotten our status update or disconnected from // block until we've either gotten our status update or disconnected from
// the device. // the device.
std::lock_guard lk(heartbeatMutex); std::lock_guard<std::mutex> lk(heartbeatMutex);
if(heartbeatSuppressed()) if(heartbeatSuppressed())
continue; continue;
@ -679,9 +679,9 @@ optional<double> Device::getAnalogIO(IO type, size_t number /* = 1 */) {
} }
Lifetime Device::suppressDisconnects() { Lifetime Device::suppressDisconnects() {
std::lock_guard lk(heartbeatMutex); std::lock_guard<std::mutex> lk(heartbeatMutex);
heartbeatSuppressedByUser++; heartbeatSuppressedByUser++;
return Lifetime([this] { std::lock_guard lk2(heartbeatMutex); heartbeatSuppressedByUser--; }); return Lifetime([this] { std::lock_guard<std::mutex> lk2(heartbeatMutex); heartbeatSuppressedByUser--; });
} }
void Device::addExtension(std::shared_ptr<DeviceExtension>&& extension) { void Device::addExtension(std::shared_ptr<DeviceExtension>&& extension) {