Cleaned up variable names for std::lock_guard and their associated mutexes (#759)

This commit is contained in:
Tyler Veness
2017-11-22 17:10:21 -08:00
committed by Peter Johnson
parent 96de0b5b11
commit ba879f4663
22 changed files with 136 additions and 137 deletions

View File

@@ -40,7 +40,7 @@ void Scheduler::SetEnabled(bool enabled) { m_enabled = enabled; }
* @param command The command to be scheduled
*/
void Scheduler::AddCommand(Command* command) {
std::lock_guard<wpi::mutex> sync(m_additionsLock);
std::lock_guard<wpi::mutex> lock(m_additionsMutex);
if (std::find(m_additions.begin(), m_additions.end(), command) !=
m_additions.end())
return;
@@ -48,7 +48,7 @@ void Scheduler::AddCommand(Command* command) {
}
void Scheduler::AddButton(ButtonScheduler* button) {
std::lock_guard<wpi::mutex> sync(m_buttonsLock);
std::lock_guard<wpi::mutex> lock(m_buttonsMutex);
m_buttons.push_back(button);
}
@@ -114,7 +114,7 @@ void Scheduler::Run() {
{
if (!m_enabled) return;
std::lock_guard<wpi::mutex> sync(m_buttonsLock);
std::lock_guard<wpi::mutex> lock(m_buttonsMutex);
for (auto rButtonIter = m_buttons.rbegin(); rButtonIter != m_buttons.rend();
rButtonIter++) {
(*rButtonIter)->Execute();
@@ -144,7 +144,7 @@ void Scheduler::Run() {
// Add the new things
{
std::lock_guard<wpi::mutex> sync(m_additionsLock);
std::lock_guard<wpi::mutex> lock(m_additionsMutex);
for (auto additionsIter = m_additions.begin();
additionsIter != m_additions.end(); additionsIter++) {
ProcessCommandAddition(*additionsIter);