mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Remove priority mutex (#644)
* Removed hal::priority_condition_variable * Replaced uses of priority mutexes with std::mutex and std::recursive_mutex This allowed replacing a use of std::condition_variable_any with std::condition_variable. * Replaced all uses of std::recursive_mutex with std::mutex equivalents
This commit is contained in:
committed by
Peter Johnson
parent
19addb04cf
commit
dd66b23845
@@ -26,7 +26,7 @@ namespace hal {
|
||||
|
||||
std::string SerialHelper::m_usbNames[2]{"", ""};
|
||||
|
||||
priority_mutex SerialHelper::m_nameMutex;
|
||||
std::mutex SerialHelper::m_nameMutex;
|
||||
|
||||
SerialHelper::SerialHelper() {
|
||||
viOpenDefaultRM(reinterpret_cast<ViSession*>(&m_resourceHandle));
|
||||
@@ -287,7 +287,7 @@ done:
|
||||
|
||||
int32_t SerialHelper::GetIndexForPort(HAL_SerialPort port, int32_t* status) {
|
||||
// Hold lock whenever we're using the names array
|
||||
std::lock_guard<hal::priority_mutex> lock(m_nameMutex);
|
||||
std::lock_guard<std::mutex> lock(m_nameMutex);
|
||||
|
||||
std::string portString = m_usbNames[port - 2];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user