lock syntax error

This commit is contained in:
Philippe G
2021-12-24 01:09:34 -08:00
parent 662962ddb1
commit 523127bdea

View File

@@ -149,7 +149,7 @@ RECONNECT:
void MercuryManager::runTask()
{
std::scoped_lock(this->runningMutex);
std::scoped_lock lock(this->runningMutex);
// Listen for mercury replies and handle them accordingly
isRunning = true;
while (isRunning)
@@ -161,9 +161,10 @@ void MercuryManager::runTask()
}
catch (const std::runtime_error& e)
{
if (!isRunning) break;
// Reconnection required
if (isRunning) this->reconnect();
if (isRunning) this->reconnectedCallback();
this->reconnect();
this->reconnectedCallback();
continue;
}
if (static_cast<MercuryType>(packet->command) == MercuryType::PING) // @TODO: Handle time synchronization through ping
@@ -191,7 +192,7 @@ void MercuryManager::stop() {
CSPOT_LOG(debug, "Stopping mercury manager");
isRunning = false;
audioChunkManager->close();
std::scoped_lock(audioChunkManager->runningMutex, this->runningMutex);
std::scoped_lock lock(audioChunkManager->runningMutex, this->runningMutex);
CSPOT_LOG(debug, "mercury stopped");
}