mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
Use wpi::mutex instead of std::mutex. (#730)
This uses a priority-aware mutex on Linux platforms. Fixes #729.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user