Skip to content

Commit

Permalink
putting unique_lock in separate scope
Browse files Browse the repository at this point in the history
Signed-off-by: pietfried <[email protected]>
  • Loading branch information
Pietfried committed Jul 8, 2024
1 parent 0a4b992 commit b37b59c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/EvseManager/EvseManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -899,10 +899,12 @@ void EvseManager::ready() {
}
});

// wait for first powermeter value
std::unique_lock<std::mutex> lk(powermeter_mutex);
this->powermeter_cv.wait_for(lk, std::chrono::milliseconds(this->config.initial_meter_value_timeout_ms),
[this] { return initial_powermeter_value_received; });
{
// wait for first powermeter value
std::unique_lock<std::mutex> lk(powermeter_mutex);
this->powermeter_cv.wait_for(lk, std::chrono::milliseconds(this->config.initial_meter_value_timeout_ms),
[this] { return initial_powermeter_value_received; });
}

// start with a limit of 0 amps. We will get a budget from EnergyManager that is locally limited by hw
// caps.
Expand Down

0 comments on commit b37b59c

Please sign in to comment.