mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Cleaned up variable names for std::lock_guard and their associated mutexes (#759)
This commit is contained in:
committed by
Peter Johnson
parent
96de0b5b11
commit
ba879f4663
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user