Use wpi::mutex instead of std::mutex. (#730)

This uses a priority-aware mutex on Linux platforms.

Fixes #729.
This commit is contained in:
Peter Johnson
2017-11-13 09:51:48 -08:00
committed by GitHub
parent 35d68d2a34
commit 4d559f3856
86 changed files with 491 additions and 839 deletions

View File

@@ -7,9 +7,10 @@
#pragma once
#include <mutex>
#include <set>
#include <support/mutex.h>
#include "ErrorBase.h"
namespace frc {
@@ -37,13 +38,13 @@ class MotorSafetyHelper : public ErrorBase {
// the FPGA clock value when this motor has expired
double m_stopTime;
// protect accesses to the state for this object
mutable std::mutex m_syncMutex;
mutable wpi::mutex m_syncMutex;
// the object that is using the helper
MotorSafety* m_safeObject;
// List of all existing MotorSafetyHelper objects.
static std::set<MotorSafetyHelper*> m_helperList;
// protect accesses to the list of helpers
static std::mutex m_listMutex;
static wpi::mutex m_listMutex;
};
} // namespace frc