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

@@ -31,7 +31,7 @@ int32_t SPIAccelerometerData::RegisterActiveCallback(
if (callback == nullptr) return -1;
int32_t newUid = 0;
{
std::lock_guard<std::mutex> lock(m_registerMutex);
std::lock_guard<wpi::mutex> lock(m_registerMutex);
m_activeCallbacks =
RegisterCallback(m_activeCallbacks, "Active", callback, param, &newUid);
}
@@ -67,7 +67,7 @@ int32_t SPIAccelerometerData::RegisterRangeCallback(HAL_NotifyCallback callback,
if (callback == nullptr) return -1;
int32_t newUid = 0;
{
std::lock_guard<std::mutex> lock(m_registerMutex);
std::lock_guard<wpi::mutex> lock(m_registerMutex);
m_rangeCallbacks =
RegisterCallback(m_rangeCallbacks, "Range", callback, param, &newUid);
}
@@ -103,7 +103,7 @@ int32_t SPIAccelerometerData::RegisterXCallback(HAL_NotifyCallback callback,
if (callback == nullptr) return -1;
int32_t newUid = 0;
{
std::lock_guard<std::mutex> lock(m_registerMutex);
std::lock_guard<wpi::mutex> lock(m_registerMutex);
m_xCallbacks =
RegisterCallback(m_xCallbacks, "X", callback, param, &newUid);
}
@@ -139,7 +139,7 @@ int32_t SPIAccelerometerData::RegisterYCallback(HAL_NotifyCallback callback,
if (callback == nullptr) return -1;
int32_t newUid = 0;
{
std::lock_guard<std::mutex> lock(m_registerMutex);
std::lock_guard<wpi::mutex> lock(m_registerMutex);
m_yCallbacks =
RegisterCallback(m_yCallbacks, "Y", callback, param, &newUid);
}
@@ -175,7 +175,7 @@ int32_t SPIAccelerometerData::RegisterZCallback(HAL_NotifyCallback callback,
if (callback == nullptr) return -1;
int32_t newUid = 0;
{
std::lock_guard<std::mutex> lock(m_registerMutex);
std::lock_guard<wpi::mutex> lock(m_registerMutex);
m_zCallbacks =
RegisterCallback(m_zCallbacks, "Z", callback, param, &newUid);
}