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

@@ -53,11 +53,11 @@ class Scheduler : public ErrorBase, public NamedSendable {
void ProcessCommandAddition(Command* command);
Command::SubsystemSet m_subsystems;
priority_mutex m_buttonsLock;
hal::priority_mutex m_buttonsLock;
typedef std::vector<ButtonScheduler*> ButtonVector;
ButtonVector m_buttons;
typedef std::vector<Command*> CommandVector;
priority_mutex m_additionsLock;
hal::priority_mutex m_additionsLock;
CommandVector m_additions;
typedef std::set<Command*> CommandSet;
CommandSet m_commands;

View File

@@ -113,7 +113,7 @@ class ErrorBase {
protected:
mutable Error m_error;
// TODO: Replace globalError with a global list of all errors.
static priority_mutex _globalErrorMutex;
static hal::priority_mutex _globalErrorMutex;
static Error _globalError;
};

View File

@@ -136,7 +136,7 @@ class PIDController : public LiveWindowSendable,
std::queue<double> m_buf;
double m_bufTotal = 0;
mutable priority_recursive_mutex m_mutex;
mutable hal::priority_recursive_mutex m_mutex;
std::unique_ptr<Notifier> m_controlLoop;
Timer m_setpointTimer;

View File

@@ -43,9 +43,9 @@ class Resource : public ErrorBase {
private:
std::vector<bool> m_isAllocated;
priority_recursive_mutex m_allocateLock;
hal::priority_recursive_mutex m_allocateLock;
static priority_recursive_mutex m_createLock;
static hal::priority_recursive_mutex m_createLock;
};
} // namespace frc

View File

@@ -51,7 +51,7 @@ class Timer {
double m_startTime = 0.0;
double m_accumulatedTime = 0.0;
bool m_running = false;
mutable priority_mutex m_mutex;
mutable hal::priority_mutex m_mutex;
};
} // namespace frc