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

@@ -30,18 +30,18 @@ SinkImpl::~SinkImpl() {
}
void SinkImpl::SetDescription(const wpi::Twine& description) {
std::lock_guard<wpi::mutex> lock(m_mutex);
std::lock_guard lock(m_mutex);
m_description = description.str();
}
wpi::StringRef SinkImpl::GetDescription(wpi::SmallVectorImpl<char>& buf) const {
std::lock_guard<wpi::mutex> lock(m_mutex);
std::lock_guard lock(m_mutex);
buf.append(m_description.begin(), m_description.end());
return wpi::StringRef{buf.data(), buf.size()};
}
void SinkImpl::Enable() {
std::lock_guard<wpi::mutex> lock(m_mutex);
std::lock_guard lock(m_mutex);
++m_enabledCount;
if (m_enabledCount == 1) {
if (m_source) m_source->EnableSink();
@@ -50,7 +50,7 @@ void SinkImpl::Enable() {
}
void SinkImpl::Disable() {
std::lock_guard<wpi::mutex> lock(m_mutex);
std::lock_guard lock(m_mutex);
--m_enabledCount;
if (m_enabledCount == 0) {
if (m_source) m_source->DisableSink();
@@ -59,7 +59,7 @@ void SinkImpl::Disable() {
}
void SinkImpl::SetEnabled(bool enabled) {
std::lock_guard<wpi::mutex> lock(m_mutex);
std::lock_guard lock(m_mutex);
if (enabled && m_enabledCount == 0) {
if (m_source) m_source->EnableSink();
m_enabledCount = 1;
@@ -73,7 +73,7 @@ void SinkImpl::SetEnabled(bool enabled) {
void SinkImpl::SetSource(std::shared_ptr<SourceImpl> source) {
{
std::lock_guard<wpi::mutex> lock(m_mutex);
std::lock_guard lock(m_mutex);
if (m_source == source) return;
if (m_source) {
if (m_enabledCount > 0) m_source->DisableSink();
@@ -89,13 +89,13 @@ void SinkImpl::SetSource(std::shared_ptr<SourceImpl> source) {
}
std::string SinkImpl::GetError() const {
std::lock_guard<wpi::mutex> lock(m_mutex);
std::lock_guard lock(m_mutex);
if (!m_source) return "no source connected";
return m_source->GetCurFrame().GetError();
}
wpi::StringRef SinkImpl::GetError(wpi::SmallVectorImpl<char>& buf) const {
std::lock_guard<wpi::mutex> lock(m_mutex);
std::lock_guard lock(m_mutex);
if (!m_source) return "no source connected";
// Make a copy as it's shared data
wpi::StringRef error = m_source->GetCurFrame().GetError();