Remove template types from lock RAII wrapper usages (#1756)

C++17 has template type autodeduction. These wrappers include
std::lock_guard and std::unique_lock.
This commit is contained in:
Tyler Veness
2019-07-07 19:17:14 -07:00
committed by Peter Johnson
parent e582518bae
commit 841ef5d739
90 changed files with 621 additions and 621 deletions

View File

@@ -491,7 +491,7 @@ void UsbCameraImpl::DeviceConnect() {
// Restore settings
SDEBUG3("restoring settings");
std::unique_lock<wpi::mutex> lock2(m_mutex);
std::unique_lock lock2(m_mutex);
for (size_t i = 0; i < m_propertyData.size(); ++i) {
const auto prop =
static_cast<const UsbCameraProperty*>(m_propertyData[i].get());
@@ -736,7 +736,7 @@ CS_StatusValue UsbCameraImpl::DeviceProcessCommand(
}
void UsbCameraImpl::DeviceProcessCommands() {
std::unique_lock<wpi::mutex> lock(m_mutex);
std::unique_lock lock(m_mutex);
if (m_commands.empty()) return;
while (!m_commands.empty()) {
auto msg = std::move(m_commands.back());
@@ -815,7 +815,7 @@ void UsbCameraImpl::DeviceCacheMode() {
vfmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (DoIoctl(fd, VIDIOC_G_FMT, &vfmt) != 0) {
SERROR("could not read current video mode");
std::lock_guard<wpi::mutex> lock(m_mutex);
std::lock_guard lock(m_mutex);
m_mode = VideoMode{VideoMode::kMJPEG, 320, 240, 30};
return;
}
@@ -881,7 +881,7 @@ void UsbCameraImpl::DeviceCacheMode() {
// Save to global mode
{
std::lock_guard<wpi::mutex> lock(m_mutex);
std::lock_guard lock(m_mutex);
m_mode.pixelFormat = pixelFormat;
m_mode.width = width;
m_mode.height = height;
@@ -911,7 +911,7 @@ void UsbCameraImpl::DeviceCacheProperty(
rawProp->name = "raw_" + perProp->name;
}
std::unique_lock<wpi::mutex> lock(m_mutex);
std::unique_lock lock(m_mutex);
int* rawIndex = &m_properties[rawProp->name];
bool newRaw = *rawIndex == 0;
UsbCameraProperty* oldRawProp =
@@ -1070,7 +1070,7 @@ void UsbCameraImpl::DeviceCacheVideoModes() {
}
{
std::lock_guard<wpi::mutex> lock(m_mutex);
std::lock_guard lock(m_mutex);
m_videoModes.swap(modes);
}
m_notifier.NotifySource(*this, CS_SOURCE_VIDEOMODES_UPDATED);
@@ -1085,14 +1085,14 @@ CS_StatusValue UsbCameraImpl::SendAndWait(Message&& msg) const {
// Add the message to the command queue
{
std::lock_guard<wpi::mutex> lock(m_mutex);
std::lock_guard lock(m_mutex);
m_commands.emplace_back(std::move(msg));
}
// Signal the camera thread
if (eventfd_write(fd, 1) < 0) return CS_SOURCE_IS_DISCONNECTED;
std::unique_lock<wpi::mutex> lock(m_mutex);
std::unique_lock lock(m_mutex);
while (m_active) {
// Did we get a response to *our* request?
auto it =
@@ -1120,7 +1120,7 @@ void UsbCameraImpl::Send(Message&& msg) const {
// Add the message to the command queue
{
std::lock_guard<wpi::mutex> lock(m_mutex);
std::lock_guard lock(m_mutex);
m_commands.emplace_back(std::move(msg));
}