Moves the HAL priority_ custom types to the hal namespace (#532)

There is a shim for backwards compatibility, just like the frc namespace.
As with the frc namespace, the library compiles without the shim.
This commit is contained in:
Thad House
2017-05-11 21:25:22 -07:00
committed by Peter Johnson
parent 16e71eac43
commit efec0c5cc3
47 changed files with 250 additions and 223 deletions

View File

@@ -49,7 +49,7 @@ class DigitalGlitchFilter : public SensorBase {
void DoAdd(DigitalSource* input, int requested_index);
int m_channelIndex = -1;
static priority_mutex m_mutex;
static hal::priority_mutex m_mutex;
static ::std::array<bool, 3> m_filterAllocated;
};

View File

@@ -117,7 +117,7 @@ class DriverStation : public SensorBase, public RobotStateInterface {
std::thread m_dsThread;
std::atomic<bool> m_isRunning{false};
mutable priority_mutex m_joystickDataMutex;
mutable hal::priority_mutex m_joystickDataMutex;
// Robot state status variables
bool m_userInDisabled = false;
@@ -128,7 +128,7 @@ class DriverStation : public SensorBase, public RobotStateInterface {
// Control word variables
mutable HAL_ControlWord m_controlWordCache;
mutable std::chrono::steady_clock::time_point m_lastControlWordUpdate;
mutable priority_mutex m_controlWordMutex;
mutable hal::priority_mutex m_controlWordMutex;
double m_nextMessageTime = 0;
};

View File

@@ -37,13 +37,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 priority_recursive_mutex m_syncMutex;
mutable hal::priority_recursive_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 priority_recursive_mutex m_listMutex;
static hal::priority_recursive_mutex m_listMutex;
};
} // namespace frc

View File

@@ -44,9 +44,9 @@ class Notifier : public ErrorBase {
static void Notify(uint64_t currentTimeInt, HAL_NotifierHandle handle);
// used to constrain execution between destructors and callback
static priority_mutex m_destructorMutex;
static hal::priority_mutex m_destructorMutex;
// held while updating process information
priority_mutex m_processMutex;
hal::priority_mutex m_processMutex;
// HAL handle, atomic for proper destruction
std::atomic<HAL_NotifierHandle> m_notifier{0};
// address of the handler